summaryrefslogtreecommitdiff
path: root/.github/workflows/trigger-rebuild-repo-package.yml
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2024-09-05 16:35:49 +0000
committerViacheslav Hletenko <v.gletenko@vyos.io>2024-09-09 11:40:43 +0300
commitd6cb7f9963571e116fbbcfb69544f3dbaf12db19 (patch)
treeee4d153e6e27bc26e477d96abc024760f2b8358f /.github/workflows/trigger-rebuild-repo-package.yml
parent9a92c365faf9ef6a8ce30e003d05dc9a52d9b788 (diff)
downloadvyos-1x-d6cb7f9963571e116fbbcfb69544f3dbaf12db19.tar.gz
vyos-1x-d6cb7f9963571e116fbbcfb69544f3dbaf12db19.zip
T6674: workflow: Add trigger to rebuild repo package
(cherry picked from commit f1fd13941ed3c7c6f1504957066d0d8780709cc2)
Diffstat (limited to '.github/workflows/trigger-rebuild-repo-package.yml')
-rw-r--r--.github/workflows/trigger-rebuild-repo-package.yml32
1 files changed, 32 insertions, 0 deletions
diff --git a/.github/workflows/trigger-rebuild-repo-package.yml b/.github/workflows/trigger-rebuild-repo-package.yml
new file mode 100644
index 000000000..fb4558fc4
--- /dev/null
+++ b/.github/workflows/trigger-rebuild-repo-package.yml
@@ -0,0 +1,32 @@
+name: Trigger to build a deb package from repo
+
+on:
+ pull_request:
+ types:
+ - closed
+ branches:
+ - circinus
+ 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 }}"}}'