-
Notifications
You must be signed in to change notification settings - Fork 1
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
4e16d8f
commit 331b2a9
Showing
1 changed file
with
9 additions
and
35 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 |
---|---|---|
@@ -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 }} |