ci(testing): add pr to project automatically #15
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 project | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check PR title with regex | |
id: check_title | |
env: | |
TITLE: ${{ github.event.pull_request.title }} | |
run: | | |
if [[ "$TITLE" =~ \(.*l1.*\) || "$TITLE" =~ \(.*levm.*\) || "$TITLE" =~ \(.*core.*\) ]]; then | |
echo "match=true" >> $GITHUB_OUTPUT | |
else | |
echo "match=false" >> $GITHUB_OUTPUT | |
fi | |
- name: Add to project if title matches | |
if: steps.check_title.outputs.match == '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 }} |