Skip to content

Commit

Permalink
feat: dispatch the action
Browse files Browse the repository at this point in the history
  • Loading branch information
mul14 committed Sep 5, 2024
1 parent 8e0624b commit 86fc971
Showing 1 changed file with 12 additions and 22 deletions.
34 changes: 12 additions & 22 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,28 +60,18 @@ jobs:
push-version:
needs: build-and-release
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
if: github.ref_type == 'tag'
permissions:
contents: write
actions: write
env:
GITHUB_TOKEN: ${{ secrets.TARGET_REPO_TOKEN }}
steps:
- name: Checkout target repo
run: |
git clone https://$GITHUB_USER:[email protected]/sev-2/docs.git docs
- name: Write JSON file
- name: Dispatch the action to "sev-2/docs"
run: |
echo "{\"version\": \"$GITHUB_REF_NAME\"}" > docs/public/latest.json
- name: Commit and push changes
run: |
cd docs
git config --global user.name "raiden-ci"
git config --global user.email "[email protected]"
git remote set-url origin https://$GITHUB_USER:[email protected]/sev-2/docs.git
git add .
git commit -m "Update to version $GITHUB_REF_NAME"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_USER: ${{ secrets.TARGET_USERNAME }}
curl -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-H "Content-Type: application/json" \
--data '{"event_type": "update-repo", "client_payload": {"RAIDEN_VERSION": "$GITHUB_REF_NAME"}}' \
https://api.github.com/repos/sev-2/docs/dispatches

0 comments on commit 86fc971

Please sign in to comment.