forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9c992a7
commit 0303334
Showing
2 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Comment on first contribution | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
issue_message: | ||
description: > | ||
The Markdown message to comment when a contributor creates their first | ||
issue. | ||
type: string | ||
required: false | ||
pull_request_message: | ||
description: > | ||
The Markdown message to comment when a contributor creates their first | ||
pull request. | ||
type: string | ||
required: false | ||
|
||
jobs: | ||
comment: | ||
if: > | ||
((github.event_name == 'pull_request_target' && | ||
inputs.pull_request_message) || | ||
(github.event_name == 'issues' && inputs.issue_message)) && | ||
github.event.action == 'opened' | ||
# && | ||
# contains( | ||
# fromJSON('["FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR"]'), | ||
# github.event.author_association | ||
# ) | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
steps: | ||
- run: echo '${{ github.event.issue.author_association }}==' | ||
- uses: actions/github-script@v7 | ||
env: | ||
message: >- | ||
${{ | ||
(github.event_name == 'issues') | ||
&& inputs.issue_message | ||
|| inputs.pull_request_message | ||
}} | ||
with: | ||
script: | | ||
await github.rest.issues.createComment({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body: process.env.message | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Comment on first contribution local | ||
|
||
run-name: >- | ||
Comment on first contribution in | ||
#${{ | ||
github.event_name == 'pull_request_target' | ||
&& github.event.pull_request.number | ||
|| github.event.issue.number | ||
}} | ||
on: [pull_request_target, issues] | ||
|
||
jobs: | ||
comment: | ||
uses: AnthonyLatsis/swift/.github/workflows/comment_on_first_contribution.yml@master | ||
with: | ||
pull_request_message: | | ||
Test *message* (`pull request`) | ||
New line | ||
issue_message: "Test *message* (`issue`)" |