replace twitter with hackyderm #59
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
name: Hello on PR or Issue | |
on: | |
workflow_dispatch: | |
pull_request: | |
types: [opened] | |
issues: | |
types: [opened] | |
jobs: | |
comment: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Is Global team member? | |
run: | | |
author=$(jq -r '.pull_request.user.login' "$GITHUB_EVENT_PATH") | |
hello='false' | |
is_member=$(curl -s \ | |
-o /dev/null -w "%{http_code}" \ | |
-H "Authorization: Bearer ${{ secrets.GLOBAL_GHA_PAT }}" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
https://api.github.com/orgs/rladies/teams/global/memberships/${author}) | |
if [[ "$is_member" == "200" ]]; then | |
hello='true' | |
fi | |
echo "say_hello=${hello}" >> $GITHUB_ENV | |
- name: Comment on PR or Issue | |
if: env.TERMINUS_RELEASE == 'true' | |
uses: peter-evans/repository-dispatch@v1 | |
with: | |
token: ${{ secrets.GLOBAL_GHA_PAT }} | |
repository: ${{ github.repository }} | |
event-type: issue_comment | |
client-payload: | | |
'{"body": "Hello! :wave: | |
Thanks for opening this PR/Issue. | |
We are a volunteer organisation, | |
but we will get back to you as soon as we can." }' |