summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2024-09-12 10:10:07 +0300
committerGitHub <noreply@github.com>2024-09-12 10:10:07 +0300
commitfe67039aa3e213cfa8d2c41c2990c60d1a96924c (patch)
treef49ab9924a22a15729cba225241059d72866b85e
parentdc7abeb08f4bfe9bd1b3106ba45692c7490d20a6 (diff)
downloadvyos-1x-fe67039aa3e213cfa8d2c41c2990c60d1a96924c.tar.gz
vyos-1x-fe67039aa3e213cfa8d2c41c2990c60d1a96924c.zip
T6674: Use reusable workflow for trigger package build (#4049)
-rw-r--r--.github/workflows/trigger-rebuild-repo-package.yml33
1 files changed, 17 insertions, 16 deletions
diff --git a/.github/workflows/trigger-rebuild-repo-package.yml b/.github/workflows/trigger-rebuild-repo-package.yml
index 9c1176b01..d0936b572 100644
--- a/.github/workflows/trigger-rebuild-repo-package.yml
+++ b/.github/workflows/trigger-rebuild-repo-package.yml
@@ -9,24 +9,25 @@ 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@current
+ with:
+ branch: ${{ github.ref_name }}
+ package_name: ${{ needs.get_repo_name.outputs.PACKAGE_NAME }}
+ REF: main # optinal because the default value is main
+ secrets:
+ REMOTE_OWNER: ${{ secrets.REMOTE_OWNER }}
+ REMOTE_REUSE_REPO: ${{ secrets.REMOTE_REUSE_REPO }}
+ GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
+ PAT: ${{ secrets.PAT }}