ci(testing): add pr to project automatically #24
This file contains hidden or 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: Add PR to Project | |
on: | |
pull_request: | |
types: | |
- opened | |
- edited | |
- synchronize | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
add-to-project: | |
name: Add pull request to appropriate project(s) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Match PR title to projects | |
id: check_title | |
env: | |
TITLE: ${{ github.event.pull_request.title }} | |
run: | | |
match_ethrex_l1=false | |
match_ethrex_l2=false | |
if [[ "$TITLE" =~ \(.*l1.*\) || "$TITLE" =~ \(.*levm.*\) ]]; then | |
match_ethrex_l1=true | |
fi | |
if [[ "$TITLE" =~ \(.*l2.*\) ]]; then | |
match_ethrex_l2=true | |
fi | |
if [[ "$TITLE" =~ \(.*core.*\) ]]; then | |
match_ethrex_l1=true | |
match_ethrex_l2=true | |
fi | |
echo "match_ethrex_l1=$match_ethrex_l1" >> $GITHUB_OUTPUT | |
echo "match_ethrex_l2=$match_ethrex_l2" >> $GITHUB_OUTPUT | |
- name: Add PR to ethrex_l1 project | |
if: steps.check_title.outputs.match_ethrex_l1 == 'true' | |
continue-on-error: true | |
uses: actions/add-to-project@v1.0.2 | |
with: | |
project-url: https://github.com/orgs/lambdaclass/projects/31 | |
github-token: ${{ secrets.GH_PROJECT_PERSONAL_ACCESS_TOKEN }} | |
- name: Add PR to ethrex_l2 project | |
if: steps.check_title.outputs.match_ethrex_l2 == 'true' | |
continue-on-error: true | |
uses: actions/add-to-project@v1.0.2 | |
with: | |
project-url: https://github.com/orgs/lambdaclass/projects/37 | |
github-token: ${{ secrets.GH_PROJECT_PERSONAL_ACCESS_TOKEN }} |