diff options
author | Christian Breunig <christian@breunig.cc> | 2024-12-23 19:22:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-23 19:22:16 +0100 |
commit | b05cbfa71570bce1f4f470551e5c0217d14ba5a8 (patch) | |
tree | 429fe0576ed88bf27a72cedf5f4382b2bf51f4dc /.github | |
parent | 6f6aa048da82d579e0b116ba346ec1dd28e65436 (diff) | |
parent | cd10c816d1659d35f8f48a5dac1b65cc5625a37e (diff) | |
download | vyos-1x-b05cbfa71570bce1f4f470551e5c0217d14ba5a8.tar.gz vyos-1x-b05cbfa71570bce1f4f470551e5c0217d14ba5a8.zip |
Merge pull request #4254 from kumvijaya/current
T6976: mirror workflows updated to use reusable workflows
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/cleanup-mirror-pr-branch.yml | 26 | ||||
-rw-r--r-- | .github/workflows/trigger-pr-mirror-repo-sync.yml | 32 |
2 files changed, 6 insertions, 52 deletions
diff --git a/.github/workflows/cleanup-mirror-pr-branch.yml b/.github/workflows/cleanup-mirror-pr-branch.yml index c5de9ab73..bbe6aa2f2 100644 --- a/.github/workflows/cleanup-mirror-pr-branch.yml +++ b/.github/workflows/cleanup-mirror-pr-branch.yml @@ -5,31 +5,11 @@ on: types: [closed] branches: - current - workflow_dispatch: - inputs: - branch: - description: 'Branch to delete' - required: true permissions: contents: write jobs: - delete_branch: - if: ${{ (github.event_name == 'workflow_dispatch' || startsWith(github.event.pull_request.head.ref, 'mirror/')) && github.repository_owner != 'vyos' }} - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Delete branch - run: | - branch=${{ github.event_name == 'workflow_dispatch' && github.event.inputs.branch || github.event.pull_request.head.ref }} - if [[ $branch != mirror/* ]]; then - echo "Branch name to clean must start with 'mirror/'" - exit 1 - fi - repo=${{ github.repository }} - git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} - git push origin --delete $branch + call-delete-branch: + uses: vyos/.github/.github/workflows/cleanup-mirror-pr-branch.yml@current + secrets: inherit diff --git a/.github/workflows/trigger-pr-mirror-repo-sync.yml b/.github/workflows/trigger-pr-mirror-repo-sync.yml index 9653c2dca..d5e8ce3b4 100644 --- a/.github/workflows/trigger-pr-mirror-repo-sync.yml +++ b/.github/workflows/trigger-pr-mirror-repo-sync.yml @@ -6,33 +6,7 @@ on: branches: - current -env: - GH_TOKEN: ${{ secrets.PAT }} - -concurrency: - group: trigger-pr-mirror-repo-sync-${{ github.event.pull_request.base.ref }} - cancel-in-progress: false jobs: - trigger-mirror-pr-repo-sync: - if: ${{ github.repository_owner == 'vyos' }} - runs-on: ubuntu-latest - permissions: - pull-requests: write - contents: write - - steps: - - name: Bullfrog Secure Runner - uses: bullfrogsec/bullfrog@v0 - with: - egress-policy: audit - - - name: Trigger repo sync - shell: bash - run: | - echo "Triggering sync workflow for ${{ secrets.REMOTE_OWNER }}/${{ secrets.REMOTE_REPO }}" - echo "Triggering sync workflow with PAT ${{ secrets.PAT }}" - curl -X POST \ - -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Authorization: Bearer ${{ secrets.PAT }}" \ - https://api.github.com/repos/${{ secrets.REMOTE_OWNER }}/${{ secrets.REMOTE_REPO }}/actions/workflows/mirror-pr-and-sync.yml/dispatches \ - -d '{"ref":"git-actions", "inputs": {"pr_number": "${{ github.event.pull_request.number }}", "sync_branch": "${{ github.event.pull_request.base.ref }}"}}' + call-trigger-mirror-pr-repo-sync: + uses: vyos/.github/.github/workflows/trigger-pr-mirror-repo-sync.yml@current + secrets: inherit |