From 5a46dc3182965b324fc149f0ae678c61ff127c75 Mon Sep 17 00:00:00 2001 From: Jacob Bolda Date: Thu, 27 Jun 2024 16:57:45 -0500 Subject: [PATCH] add workflow_run and bump covector to comment on forks --- .../workflows/covector-comment-on-fork.yml | 28 +++++++++++++++++++ .github/workflows/covector-status.yml | 11 +++++--- 2 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/covector-comment-on-fork.yml diff --git a/.github/workflows/covector-comment-on-fork.yml b/.github/workflows/covector-comment-on-fork.yml new file mode 100644 index 000000000..7cf061321 --- /dev/null +++ b/.github/workflows/covector-comment-on-fork.yml @@ -0,0 +1,28 @@ +name: covector comment +on: + workflow_run: + workflows: [covector status] # the `name` of the workflow run on `pull_request` running `status` with `comment: true` + types: + - completed + +# note all other permissions are set to none if not specified +# and these set the permissions for `secrets.GITHUB_TOKEN` +permissions: + # to read the action artifacts on `covector status` workflows + actions: read + # to write the comment + pull-requests: write + +jobs: + download: + runs-on: ubuntu-latest + if: github.event.workflow_run.conclusion == 'success' && + (github.event.workflow_run.head_repository.full_name != github.repository || github.actor == 'dependabot[bot]') + steps: + - name: covector status + # note we are using the release branch temporarily awaiting a publish of these versions: https://github.com/jbolda/covector/pull/317 + # those changes include updates to support commenting from forks + uses: jbolda/covector/packages/action@release + with: + token: ${{ secrets.GITHUB_TOKEN }} + command: "status" diff --git a/.github/workflows/covector-status.yml b/.github/workflows/covector-status.yml index 69fe9db74..d3ccbf8ef 100644 --- a/.github/workflows/covector-status.yml +++ b/.github/workflows/covector-status.yml @@ -7,10 +7,13 @@ jobs: steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: covector status - uses: jbolda/covector/packages/action@covector-v0 - id: covector + # note we are using the release branch temporarily awaiting a publish of these versions: https://github.com/jbolda/covector/pull/317 + # those changes include updates to support commenting from forks + uses: jbolda/covector/packages/action@release with: - command: 'status' + command: "status" token: ${{ secrets.GITHUB_TOKEN }} - comment: true \ No newline at end of file + comment: true