-
Notifications
You must be signed in to change notification settings - Fork 6
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
Showing
3 changed files
with
102 additions
and
24 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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: "PR Reports" | ||
on: | ||
workflow_run: | ||
workflows: ["CI"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
report: | ||
name: "Report" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get PR issue number | ||
id: get-pr | ||
uses: octokit/[email protected] | ||
with: | ||
route: GET /repos/${{ github.event.workflow_run.repository.full_name }}/actions/runs/${{ github.event.workflow_run.id }} | ||
- name: Extract PR number | ||
run: | | ||
${{ steps.get-pr.outputs.data }} | ||
# Extract the PR number from the 'head_branch' field | ||
pr_number=$(echo '${{ steps.get-pr.outputs.data }}' | jq -r '.head_branch' | grep -oP 'pull/\K\d+') | ||
# Check if the workflow run was for a PR | ||
if [ -z "$pr_number" ]; then | ||
echo "This workflow run was not for a PR." | ||
else | ||
echo "This workflow run was for PR #$pr_number." | ||
fi |
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
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 |
---|---|---|
|
@@ -5,12 +5,40 @@ on: | |
- main | ||
pull_request: | ||
paths: | ||
- '.devcontainer/**' | ||
- ".devcontainer/**" | ||
|
||
jobs: | ||
build: | ||
name: "Build and publish" | ||
name: "Build devcontainer" | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: read | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Pre-build dev container image | ||
uses: devcontainers/[email protected] | ||
with: | ||
imageName: ghcr.io/reubeno/brush/devcontainer | ||
imageTag: latest | ||
cacheFrom: ghcr.io/reubeno/brush/devcontainer | ||
push: never | ||
|
||
build_and_publish: | ||
name: "Build and publish devcontainer" | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|