From 18cecf124ffb7860f976f4244c7fbe3be6ec2d3d Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Mon, 18 Nov 2024 17:23:33 +0100 Subject: [PATCH 1/2] chore(ci): make release-notes-assistant job copy/pastable Refs: forgejo/forgejo#5999 --- .../workflows/release-notes-assistant.yml | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/.forgejo/workflows/release-notes-assistant.yml b/.forgejo/workflows/release-notes-assistant.yml index b1e2578fcf..bd668d82b6 100644 --- a/.forgejo/workflows/release-notes-assistant.yml +++ b/.forgejo/workflows/release-notes-assistant.yml @@ -1,3 +1,5 @@ +name: issue-labels + on: pull_request_target: types: @@ -7,22 +9,31 @@ on: jobs: release-notes: - if: ( vars.ROLE == 'forgejo-coding' ) && contains(github.event.pull_request.labels.*.name, 'worth a release-note') + if: > + vars.ROLE == 'forgejo-coding' && + + secrets.RELEASE_NOTES_ASSISTANT_TOKEN != '' && + + github.event_name == 'pull_request' && + contains(github.event.pull_request.labels.*.name, 'worth a release-note') && + ( + github.event.action == 'label_updated' || + github.event.action == 'edited' || + github.event.action == 'synchronized' + ) + runs-on: docker container: image: 'code.forgejo.org/oci/node:20-bookworm' steps: - - uses: https://code.forgejo.org/actions/checkout@v4 - - - name: event + - name: Debug info run: | cat <<'EOF' - ${{ toJSON(github.event.pull_request.labels.*.name) }} - EOF - cat <<'EOF' - ${{ toJSON(github.event) }} + ${{ toJSON(github) }} EOF + - uses: https://code.forgejo.org/actions/checkout@v4 + - uses: https://code.forgejo.org/actions/setup-go@v5 with: go-version-file: "go.mod" From 73cb6c9204aefce1502a1d1016cc080b6b53c519 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Mon, 18 Nov 2024 18:11:07 +0100 Subject: [PATCH 2/2] chore(ci): make release-notes-assistant job copy/pastable (part two) The event is pull_request_target Refs: forgejo/forgejo#5999 --- .forgejo/workflows/release-notes-assistant.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/release-notes-assistant.yml b/.forgejo/workflows/release-notes-assistant.yml index bd668d82b6..71c8d5f8da 100644 --- a/.forgejo/workflows/release-notes-assistant.yml +++ b/.forgejo/workflows/release-notes-assistant.yml @@ -14,7 +14,7 @@ jobs: secrets.RELEASE_NOTES_ASSISTANT_TOKEN != '' && - github.event_name == 'pull_request' && + github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'worth a release-note') && ( github.event.action == 'label_updated' ||