Skip to content

Commit

Permalink
Update add-prs-to-project.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli authored Jun 17, 2024
1 parent 4e16d8f commit 331b2a9
Showing 1 changed file with 9 additions and 35 deletions.
44 changes: 9 additions & 35 deletions .github/workflows/add-prs-to-project.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,21 @@
# This is a basic workflow to help you get started with Actions
name: Add pull request to project
name: Add new pull requests to a github project

# Controls when the workflow will run
on:
pull_request:
types:
- opened

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
- ready_for_review

permissions: {}

jobs:
add-to-project:
name: Add pull request to project
# Only run on the GuySartorelli account
if: github.repository_owner == 'GuySartorelli'
permissions:
repository-projects: write
addprtoproject:
# Only run on the silverstripe account
if: github.repository_owner == 'silverstripe'
runs-on: ubuntu-latest
steps:

- name: Check if should be added
id: check-if-should-add
env:
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
run: |
echo "Author is $PR_AUTHOR"
for squad_member in 'GuySartorelli-false' 'emteknetnz' 'maxime-rainville'; do
if [[ $PR_AUTHOR == $squad_member ]]; then
echo "Author is in CMS Squad. Skipping."
echo "should_add_to_project=false" >> $GITHUB_OUTPUT
exit 0
fi
done
echo "try add to project - not cms squad member"
echo "should_add_to_project=true" >> $GITHUB_OUTPUT
- name: Add to project
uses: actions/[email protected]
if: steps.check-if-should-add.outputs.should_add_to_project == 'true'
- name: Add PR to github project
uses: GuySartorelli/gha-add-pr-to-project@fork-to-check-logs
with:
# Add to the Community Contributions project
project-url: https://github.com/users/GuySartorelli/projects/1
github-token: ${{ secrets.GITHUB_TOKEN }}
app_id: ${{ vars.TEST_APP_ID }}
private_key: ${{ secrets.TEST_APP_KEY }}

0 comments on commit 331b2a9

Please sign in to comment.