From 24e645ddcf6598ea084083bbd16c9160ce32e3b6 Mon Sep 17 00:00:00 2001 From: kumvijaya Date: Tue, 7 Apr 2026 00:18:26 +0530 Subject: T8218: Updated workflows for pullrequest_target policy change --- .github/workflows/trigger-rebuild-repo-package.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/trigger-rebuild-repo-package.yml b/.github/workflows/trigger-rebuild-repo-package.yml index 37ec8327..5630f3cc 100644 --- a/.github/workflows/trigger-rebuild-repo-package.yml +++ b/.github/workflows/trigger-rebuild-repo-package.yml @@ -6,25 +6,33 @@ on: - closed branches: - current + - circinus + - sagitta workflow_dispatch: jobs: - get_repo_name: + setup-vars: runs-on: ubuntu-latest outputs: - PACKAGE_NAME: ${{ steps.package_name.outputs.PACKAGE_NAME }} + PACKAGE_NAME: ${{ steps.vars.outputs.PACKAGE_NAME }} + BRANCH: ${{ steps.vars.outputs.BRANCH }} steps: - name: Set variables - id: package_name + id: vars run: | echo "PACKAGE_NAME=$(basename ${{ github.repository }})" >> $GITHUB_OUTPUT + if [ "${{ github.event_name }}" = "pull_request_target" ]; then + echo "BRANCH=${{ github.event.pull_request.base.ref }}" >> $GITHUB_OUTPUT + else + echo "BRANCH=${{ github.ref_name }}" >> $GITHUB_OUTPUT + fi trigger-build: - needs: get_repo_name + needs: setup-vars 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 }} + branch: ${{ needs.setup-vars.outputs.BRANCH }} + package_name: ${{ needs.setup-vars.outputs.PACKAGE_NAME }} secrets: REMOTE_OWNER: ${{ secrets.REMOTE_OWNER }} REMOTE_REUSE_REPO: ${{ secrets.REMOTE_REUSE_REPO }} -- cgit v1.2.3