Repository navigation
Route gallery proposals through Copilot issues #89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ec1085e
ci: use Actions token for Copilot
b35f6de
ci: publish gallery proposals without PATs
a49c0d0
fix: route gallery proposals through Copilot issues
619a5a4
fix: move proposal decisions to issue comments
3688799
fix: isolate trusted proposal publication
ba0159d
fix: publish gallery proposals as issues only
268af1e
fix: make proposal issues the only scan output
268e961
fix: create issues only for actionable recommendations
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| name: Publish gallery proposal | ||
|
|
||
| on: | ||
| workflow_run: | ||
| workflows: [Audit gallery content] | ||
| types: [completed] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| publish: | ||
| if: >- | ||
| github.event.workflow_run.conclusion == 'success' && | ||
| github.event.workflow_run.event != 'pull_request' && | ||
| github.event.workflow_run.head_branch == github.event.repository.default_branch | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| permissions: | ||
| actions: read | ||
| issues: write | ||
| env: | ||
| SOURCE_RUN_ID: ${{ github.event.workflow_run.id }} | ||
| steps: | ||
| - name: Download validated proposal | ||
| id: proposal | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| run: | | ||
| artifact_name="gallery-content-proposal-$SOURCE_RUN_ID" | ||
| artifact_id=$(gh api "repos/$GITHUB_REPOSITORY/actions/runs/$SOURCE_RUN_ID/artifacts" \ | ||
| --jq ".artifacts[] | select(.name == \"$artifact_name\") | .id") | ||
| if [ -z "$artifact_id" ]; then | ||
| echo "available=false" >> "$GITHUB_OUTPUT" | ||
| exit 0 | ||
| fi | ||
| proposal_dir="$RUNNER_TEMP/gallery-proposal" | ||
| gh run download "$SOURCE_RUN_ID" --repo "$GITHUB_REPOSITORY" --name "$artifact_name" --dir "$proposal_dir" | ||
| summary_path=$(find "$proposal_dir" -type f -name promotion-summary.md -print -quit) | ||
| test -n "$summary_path" || { echo "Validated proposal summary is missing."; exit 1; } | ||
| echo "summary_path=$summary_path" >> "$GITHUB_OUTPUT" | ||
| echo "available=true" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Publish proposal issue | ||
| if: steps.proposal.outputs.available == 'true' | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| SUMMARY_PATH: ${{ steps.proposal.outputs.summary_path }} | ||
| run: | | ||
| issue_body="$RUNNER_TEMP/gallery-proposal-issue.md" | ||
| cat > "$issue_body" <<EOF | ||
| ## Validated gallery proposal | ||
|
|
||
| The automated gallery audit produced the following validated catalog proposal. | ||
|
|
||
| - [Inspect the source workflow run]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$SOURCE_RUN_ID) | ||
|
|
||
| $(cat "$SUMMARY_PATH") | ||
|
|
||
| ## Copilot task | ||
|
|
||
| Treat the edited issue body as the complete source of truth. Implement exactly the additions, URL updates, retirements, and notes that remain in this issue; ignore deleted recommendations. Modify the catalog files, run \`npm run test:gallery-audit\` and \`npm run build\`, and open a draft pull request to \`main\`. Do not add unrelated changes, approve, merge, or enable automerge. | ||
| EOF | ||
| issue_url=$(gh issue create --title "Gallery content proposal $SOURCE_RUN_ID" --body-file "$issue_body") | ||
| printf 'Proposal issue created: %s\n' "$issue_url" >> "$GITHUB_STEP_SUMMARY" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.