Skip to content

Commit d87ed49

Browse files
authored
ci: update of files from global .github repo (#2116)
1 parent d8d0db5 commit d87ed49

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

.github/workflows/welcome-first-time-contrib.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,32 @@
44
name: Welcome first time contributors
55

66
on:
7-
pull_request_target:
7+
pull_request:
88
types:
99
- opened
1010
issues:
1111
types:
1212
- opened
1313

14+
permissions:
15+
issues: read # Required to check if the issue is the user's first contribution
16+
pull-requests: read # Required to check if the pull request is the user's first contribution
17+
1418
jobs:
1519
welcome:
1620
name: Post welcome message
17-
if: ${{ !contains(fromJson('["asyncapi-bot", "dependabot[bot]", "dependabot-preview[bot]", "allcontributors[bot]"]'), github.actor) }}
21+
if: ${{ !contains(fromJson('["asyncapi-bot", "dependabot[bot]", "dependabot-preview[bot]", "allcontributors[bot]"]'), github.actor) }} # zizmor: ignore[obfuscation]
1822
runs-on: ubuntu-latest
23+
permissions:
24+
contents: read # Required to read repository data for checking if it's the user's first contribution
25+
issues: write # Required to post welcome message on issues
26+
pull-requests: write # Required to post welcome message on pull requests
1927
steps:
20-
- uses: actions/github-script@v7
28+
- uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
2129
with:
22-
github-token: ${{ secrets.GITHUB_TOKEN }}
30+
github-token: ${{ github.token }}
2331
script: |
24-
const issueMessage = `Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our [contributors guide](https://github.com/asyncapi/community/blob/master/CONTRIBUTING.md) and the instructions about a [basic recommended setup](https://github.com/asyncapi/community/blob/master/git-workflow.md) useful for opening a pull request.<br />Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out [this issue](https://github.com/asyncapi/asyncapi/issues/115).`;
32+
const issueMessage = `Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our [contributors guide](https://github.com/asyncapi/community/blob/master/CONTRIBUTING.md) and the instructions about a [basic recommended setup](https://github.com/asyncapi/community/blob/master/docs/010-contribution-guidelines/git-workflow.md) useful for opening a pull request.<br />Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out [this issue](https://github.com/asyncapi/asyncapi/issues/115).`;
2533
const prMessage = `Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our [contributors guide](https://github.com/asyncapi/community/blob/master/CONTRIBUTING.md) useful for opening a pull request.<br />Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out [this issue](https://github.com/asyncapi/asyncapi/issues/115).`;
2634
if (!issueMessage && !prMessage) {
2735
throw new Error('Action must have at least one of issue-message or pr-message set');

0 commit comments

Comments
 (0)