summaryrefslogtreecommitdiff
path: root/.github/workflows/trigger-rebuild-repo-package.yml
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2024-09-13 20:26:04 +0300
committerViacheslav Hletenko <v.gletenko@vyos.io>2024-09-14 10:26:54 +0300
commit6a758eb828fb6b547ba7ed53384502be65874562 (patch)
treebe751f4f4ab592d87d378b0be3f870876845219e /.github/workflows/trigger-rebuild-repo-package.yml
parent1c208b6b22fac13e00b2fbdccba042adcae2afc2 (diff)
downloadvyos-1x-6a758eb828fb6b547ba7ed53384502be65874562.tar.gz
vyos-1x-6a758eb828fb6b547ba7ed53384502be65874562.zip
T6674: Actions fix variable for trigger build reuse repo (#4067)mergify/bp/circinus/pr-4067
(cherry picked from commit 5df36ba0e3c95efb2962ed54e614552f7425e173)
Diffstat (limited to '.github/workflows/trigger-rebuild-repo-package.yml')
-rw-r--r--.github/workflows/trigger-rebuild-repo-package.yml34
1 files changed, 17 insertions, 17 deletions
diff --git a/.github/workflows/trigger-rebuild-repo-package.yml b/.github/workflows/trigger-rebuild-repo-package.yml
index fb4558fc4..7a6a974c3 100644
--- a/.github/workflows/trigger-rebuild-repo-package.yml
+++ b/.github/workflows/trigger-rebuild-repo-package.yml
@@ -1,7 +1,7 @@
name: Trigger to build a deb package from repo
on:
- pull_request:
+ pull_request_target:
types:
- closed
branches:
@@ -9,24 +9,24 @@ on:
workflow_dispatch:
jobs:
- trigger-build:
- if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
+ get_repo_name:
runs-on: ubuntu-latest
-
- env:
- REF: main # Used for curl to trigger build package
-
+ outputs:
+ PACKAGE_NAME: ${{ steps.package_name.outputs.PACKAGE_NAME }}
steps:
- name: Set variables
+ id: package_name
run: |
- echo "PACKAGE_NAME=$(basename ${{ github.repository }})" >> $GITHUB_ENV
+ echo "PACKAGE_NAME=$(basename ${{ github.repository }})" >> $GITHUB_OUTPUT
- - 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 }}"}}'
+ trigger-build:
+ needs: get_repo_name
+ uses: vyos/.github/.github/workflows/trigger-rebuild-repo-package.yml@circinus
+ with:
+ branch: ${{ github.ref_name }}
+ package_name: ${{ needs.get_repo_name.outputs.PACKAGE_NAME }}
+ secrets:
+ REMOTE_OWNER: ${{ secrets.REMOTE_OWNER }}
+ REMOTE_REUSE_REPO: ${{ secrets.REMOTE_REUSE_REPO }}
+ GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
+ PAT: ${{ secrets.PAT }}