Skip to content

Commit

Permalink
Merge pull request #10 from teorth/pitmonticone/add-remove-label
Browse files Browse the repository at this point in the history
Add and remove `awaiting-CI` labels
  • Loading branch information
pitmonticone authored Sep 26, 2024
2 parents 2653e33 + c6ef947 commit c55035f
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions .github/workflows/blueprint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,29 @@ concurrency:
group: ${{ github.ref }} # Group runs by the ref (branch or PR)
cancel-in-progress: true # Cancel any ongoing runs in the same group

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages and modify PR labels
permissions:
contents: read # Read access to repository contents
pages: write # Write access to GitHub Pages
id-token: write # Write access to ID tokens
contents: read # Read access to repository contents
pages: write # Write access to GitHub Pages
id-token: write # Write access to ID tokens
issues: write # Write access to issues
pull-requests: write # Write access to pull requests

jobs:
build_project:
runs-on: ubuntu-latest
name: Build project
steps:
- name: Add 'awaiting-CI' label
if: >
github.event_name == 'pull_request'
run: |
curl --request POST \
--url https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'Content-Type: application/json' \
--data '["awaiting-CI"]'
- name: Checkout project
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -125,3 +137,13 @@ jobs:

- name: Make sure the API documentation cache works
run: mv home_page/docs .lake/build/doc

- name: Remove 'awaiting-CI' label
if: >
always() &&
github.event_name == 'pull_request'
run: |
curl --request DELETE \
--url https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels/awaiting-CI \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'Content-Type: application/json'

0 comments on commit c55035f

Please sign in to comment.