forked from vyos/vyos-1x
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request vyos#4030 from sever-sever/T6674
T6674: workflow: Add trigger to rebuild repo package
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Trigger to build a deb package from repo | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
branches: | ||
- current | ||
workflow_dispatch: | ||
|
||
jobs: | ||
trigger-build: | ||
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
REF: main # Used for curl to trigger build package | ||
|
||
steps: | ||
- name: Set variables | ||
run: | | ||
echo "PACKAGE_NAME=$(basename ${{ github.repository }})" >> $GITHUB_ENV | ||
- name: Trigger rebuild for ${{ env.PACKAGE_NAME }} | ||
run: | | ||
curl -L \ | ||
-X POST \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer ${{ secrets.PAT }}" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
https://api.github.com/repos/${{ secrets.REMOTE_OWNER }}/${{ secrets.REMOTE_REUSE_REPO }}/actions/workflows/build-package.yml/dispatches \ | ||
-d '{"ref": "${{ env.REF }}", "inputs":{"package_name":"'"$PACKAGE_NAME"'", "gpg_key_id": "${{ secrets.GPG_KEY_ID }}", "package_branch": "${{ github.ref_name }}"}}' |