fix(release-notes-assistant): do not trigger on open

Forgejo sets a label and will notify this when opening the pull
request. Triggering when it opens will make two workflows for the same
SHA. Re-opening is a border case that is not needed.
This commit is contained in:
Twenty Panda 2024-07-24 17:54:48 +02:00
parent 762f4b5408
commit e9a3306f6e

View file

@ -1,8 +1,6 @@
on: on:
pull_request_target: pull_request_target:
types: types:
- opened
- reopened
- edited - edited
- synchronize - synchronize
- labeled - labeled
@ -16,6 +14,15 @@ jobs:
steps: steps:
- uses: https://code.forgejo.org/actions/checkout@v3 - uses: https://code.forgejo.org/actions/checkout@v3
- name: event
run: |
cat <<'EOF'
${{ toJSON(github.event.pull_request.labels.*.name) }}
EOF
cat <<'EOF'
${{ toJSON(github.event) }}
EOF
- uses: https://code.forgejo.org/actions/setup-go@v4 - uses: https://code.forgejo.org/actions/setup-go@v4
with: with:
go-version-file: "go.mod" go-version-file: "go.mod"
@ -29,4 +36,4 @@ jobs:
- name: release-notes-assistant preview - name: release-notes-assistant preview
run: | run: |
go run code.forgejo.org/forgejo/release-notes-assistant@v1.0.2 --config .release-notes-assistant.yaml --storage pr --storage-location ${{ github.event.pull_request.number }} --forgejo-url $GITHUB_SERVER_URL --repository $GITHUB_REPOSITORY --token ${{ secrets.RELEASE_NOTES_ASSISTANT_TOKEN }} preview ${{ github.event.pull_request.number }} go run code.forgejo.org/forgejo/release-notes-assistant@v1.0.3 --config .release-notes-assistant.yaml --storage pr --storage-location ${{ github.event.pull_request.number }} --forgejo-url $GITHUB_SERVER_URL --repository $GITHUB_REPOSITORY --token ${{ secrets.RELEASE_NOTES_ASSISTANT_TOKEN }} preview ${{ github.event.pull_request.number }}