diff --git a/.github/workflows/blueprint.yml b/.github/workflows/blueprint.yml index 8ce46079..9d8aa3de 100644 --- a/.github/workflows/blueprint.yml +++ b/.github/workflows/blueprint.yml @@ -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: @@ -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'