Skip to content

Commit

Permalink
feat: use dispatch actions instead of commit
Browse files Browse the repository at this point in the history
When the sev-2/raiden repo is released, it should trigger a dispatch job instead of use Personal Access Token to update this repo.
  • Loading branch information
mul14 authored Sep 5, 2024
1 parent 1eef0a5 commit 0921ff2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Receive GitHub Actions event from "sev-2/raiden" repository.
repository_dispatch:
types: [update-repo]

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
Expand All @@ -28,6 +32,16 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0 # Not needed if lastUpdated is not enabled
- name: Update Raiden version when triggered from "sev-2/raiden" repository.
if: "${{ github.event.client_payload.RAIDEN_VERSION }}"
run: |
RAIDEN_VERSION="${{ github.event.client_payload.RAIDEN_VERSION }}"
echo "{\"version\": \"$RAIDEN_VERSION\"}" > docs/public/latest.json
git config user.name "github-actions"
git config user.email "${{ github.actor }}@users.noreply.github.com"
git add docs/public/latest.json
git commit -m "Update Raiden version to $RAIDEN_VERSION"
git push origin master
- name: Setup Node
uses: actions/setup-node@v4
with:
Expand Down

0 comments on commit 0921ff2

Please sign in to comment.