-
Notifications
You must be signed in to change notification settings - Fork 0
Update contributer experience #5
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,97 +1,94 @@ | ||
| { | ||
| "image": "mcr.microsoft.com/devcontainers/base:ubuntu", | ||
| "features": { | ||
| "ghcr.io/devcontainers/features/github-cli:1": {}, | ||
| "ghcr.io/devcontainers/features/go:1": { | ||
| "version": "1.24" | ||
| }, | ||
| "ghcr.io/github/features/goproxy:1": {}, | ||
| "ghcr.io/github/features/go-linter:2": {}, | ||
| "ghcr.io/devcontainers/features/sshd:1": { | ||
| "version": "latest" | ||
| }, | ||
| "ghcr.io/devcontainers/features/node:1": { | ||
| "nodeGypDependencies": true, | ||
| "version": "lts", | ||
| "nvmVersion": "latest" | ||
| }, | ||
| "ghcr.io/devcontainers/features/hugo:1": { | ||
| "extended": true, | ||
| "version": "latest" | ||
| } | ||
| }, | ||
| "onCreateCommand": ".devcontainer/on-create-command.sh", | ||
| "postCreateCommand": "./tools/setup", | ||
| "containerEnv": { | ||
| "GOPROXY": "https://goproxy.githubapp.com/mod,https://proxy.golang.org/,direct", | ||
| "GOPRIVATE": "", | ||
| "GONOPROXY": "", | ||
| "GONOSUMDB": "github.com/github/*" | ||
| }, | ||
| "customizations": { | ||
| "vscode": { | ||
| "extensions": [ | ||
| "golang.go", | ||
| // Recommended for Hextra theme | ||
| "mhutchie.git-graph", | ||
| "esbenp.prettier-vscode", | ||
| "tamasfe.even-better-toml", | ||
| "budparr.language-hugo-vscode", | ||
| "image": "mcr.microsoft.com/devcontainers/base:ubuntu", | ||
| "containerUser": "vscode", | ||
| "features": { | ||
| "ghcr.io/devcontainers/features/github-cli:1": {}, | ||
| "ghcr.io/devcontainers/features/go:1": { | ||
| "version": "1.24" | ||
| }, | ||
| "ghcr.io/github/features/goproxy:1": {}, | ||
| "ghcr.io/github/features/go-linter:2": {}, | ||
| "ghcr.io/devcontainers/features/sshd:1": { | ||
| "version": "latest" | ||
| }, | ||
| "ghcr.io/devcontainers/features/node:1": { | ||
| "nodeGypDependencies": true, | ||
| "version": "lts", | ||
| "nvmVersion": "latest" | ||
| }, | ||
| "ghcr.io/devcontainers/features/hugo:1": { | ||
| "extended": true, | ||
| "version": "latest" | ||
| } | ||
| }, | ||
| "onCreateCommand": ".devcontainer/on-create-command.sh", | ||
| "postCreateCommand": "./tools/setup", | ||
| "containerEnv": { | ||
| "GOPROXY": "https://goproxy.githubapp.com/mod,https://proxy.golang.org/,direct", | ||
| "GOPRIVATE": "", | ||
| "GONOPROXY": "", | ||
| "GONOSUMDB": "github.com/github/*" | ||
| }, | ||
| "customizations": { | ||
| "vscode": { | ||
| "extensions": [ | ||
| "golang.go", | ||
| // Recommended for Hextra theme | ||
| "mhutchie.git-graph", | ||
| "prettier.prettier-vscode", | ||
| "tamasfe.even-better-toml", | ||
| "budparr.language-hugo-vscode", | ||
|
|
||
| // Recommended extensions from https://gohugo.io/tools/editors/#visual-studio-code | ||
| // Front Matter CMS: https://marketplace.visualstudio.com/items?itemName=eliostruyf.vscode-front-matter | ||
| "eliostruyf.vscode-front-matter", | ||
|
|
||
| // Hugo Helper: https://marketplace.visualstudio.com/items?itemName=rusnasonov.vscode-hugo | ||
| "rusnasonov.vscode-hugo", | ||
|
|
||
| // Hugo Language and Syntax Support: https://marketplace.visualstudio.com/items?itemName=budparr.language-hugo-vscode | ||
| "budparr.language-hugo-vscode", | ||
|
|
||
| // Hugo Themer: https://marketplace.visualstudio.com/items?itemName=eliostruyf.vscode-hugo-themer | ||
| "eliostruyf.vscode-hugo-themer", | ||
|
|
||
| // hugofy: https://marketplace.visualstudio.com/items?itemName=akmittal.hugofy | ||
| "akmittal.hugofy", | ||
|
|
||
| // Hugo Shortcode Syntax Highlighting: https://marketplace.visualstudio.com/items?itemName=kaellarkin.hugo-shortcode-syntax | ||
| "kaellarkin.hugo-shortcode-syntax" | ||
| ], | ||
| "settings": { | ||
| "go.lintFlags": [ | ||
| "--config=/workspaces/.golangci.toml", | ||
| "--whole-files", | ||
| "--new-from-rev=origin/main" | ||
| ] | ||
| } | ||
| }, | ||
| "codespaces": { | ||
| "repositories": { | ||
| "github/go-linter": { | ||
| "permissions": { | ||
| "contents": "read", | ||
| "packages": "read" | ||
| } | ||
| }, | ||
| "github/features": { | ||
| "permissions": { | ||
| "contents": "read", | ||
| "packages": "read" | ||
| } | ||
| }, | ||
| "github/*": { | ||
| "permissions": { | ||
| "contents": "read", | ||
| "packages": "read" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "forwardPorts": [1313], | ||
| "portsAttributes": { | ||
| "8080": { | ||
| "label": "dev-server" | ||
| } | ||
| } | ||
| // Recommended extensions from https://gohugo.io/tools/editors/#visual-studio-code | ||
| "eliostruyf.vscode-front-matter", | ||
| "rusnasonov.vscode-hugo", | ||
| "budparr.language-hugo-vscode", | ||
| "eliostruyf.vscode-hugo-themer", | ||
| "akmittal.hugofy", | ||
| "kaellarkin.hugo-shortcode-syntax" | ||
| ], | ||
| "settings": { | ||
| "go.lintFlags": [ | ||
| "--config=/workspaces/.golangci.toml", | ||
| "--whole-files", | ||
| "--new-from-rev=origin/main" | ||
| ], | ||
| "editor.defaultFormatter": "prettier.prettier-vscode", | ||
| "editor.tabSize": 2, | ||
| "editor.insertSpaces": true, | ||
| "editor.detectIndentation": false, | ||
| "prettier.requireConfig": true, | ||
| "files.insertFinalNewline": true, | ||
| "files.trimTrailingWhitespace": true | ||
| } | ||
| }, | ||
| "codespaces": { | ||
| "repositories": { | ||
| "github/go-linter": { | ||
| "permissions": { | ||
| "contents": "read", | ||
| "packages": "read" | ||
| } | ||
| }, | ||
| "github/features": { | ||
| "permissions": { | ||
| "contents": "read", | ||
| "packages": "read" | ||
| } | ||
| }, | ||
| "github/*": { | ||
| "permissions": { | ||
| "contents": "read", | ||
| "packages": "read" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "forwardPorts": [1313], | ||
| "portsAttributes": { | ||
| "8080": { | ||
| "label": "dev-server" | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| # PR Labeling Workflow | ||
| # | ||
| # Purpose: Automatically applies and removes labels on pull requests based on their status | ||
| # to improve visibility and workflow management. | ||
| # | ||
| # Triggers: | ||
| # - Pull request converted to draft | ||
| # - Pull request marked as ready for review | ||
| # - Pull request opened | ||
| # - Pull request reopened | ||
| # - Pull request closed | ||
| # | ||
| # How it works: | ||
| # - Uses GitHub CLI to modify PR labels based on the event action. | ||
| # - Continues execution even if label operations fail (uses `|| true`). | ||
| # | ||
| # Permissions: | ||
| # - pull-requests: write (required to add/remove labels) | ||
|
|
||
| name: Label PR | ||
| on: | ||
| pull_request: | ||
| types: | ||
| - converted_to_draft | ||
| - ready_for_review | ||
| - opened | ||
| - reopened | ||
| - closed | ||
|
|
||
| permissions: | ||
| pull-requests: write | ||
|
|
||
| env: | ||
| DRAFT_LABEL: "draft" | ||
| READY_LABEL: "ready for review" | ||
|
|
||
| jobs: | ||
| pr-in-draft-label: | ||
| if: github.event.action == 'converted_to_draft' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Add/Remove PR labels based on event type | ||
| shell: bash | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| PR_NUMBER: ${{ github.event.pull_request.number }} | ||
| REPO: ${{ github.repository }} | ||
| EVENT_ACTION: ${{ github.event.action }} | ||
| ADD_LABEL: ${{ env.DRAFT_LABEL }} | ||
| REMOVE_LABEL: ${{ env.READY_LABEL }} | ||
| run: &update_run | | ||
| gh pr edit "$PR_NUMBER" --repo "$REPO" --add-label "$ADD_LABEL" || true | ||
| gh pr edit "$PR_NUMBER" --repo "$REPO" --remove-label "$REMOVE_LABEL" || true | ||
|
Comment on lines
+51
to
+53
|
||
| echo "Labels updated based on event action: $EVENT_ACTION for PR #$PR_NUMBER" >> "$GITHUB_STEP_SUMMARY" | ||
|
|
||
| pr-ready-review-label: | ||
| if: github.event.action == 'ready_for_review' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Add/Remove PR labels based on event type | ||
| shell: bash | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| PR_NUMBER: ${{ github.event.pull_request.number }} | ||
| REPO: ${{ github.repository }} | ||
| EVENT_ACTION: ${{ github.event.action }} | ||
| ADD_LABEL: ${{ env.READY_LABEL }} | ||
| REMOVE_LABEL: ${{ env.DRAFT_LABEL }} | ||
| run: *update_run | ||
|
||
|
|
||
| open-pr-label: | ||
| if: github.event.action == 'opened' || github.event.action == 'reopened' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Set labels based on draft status | ||
| shell: bash | ||
| run: | | ||
| if [[ "${{ github.event.pull_request.draft }}" == "true" ]]; then | ||
| echo "ADD_LABEL_VALUE=${{ env.DRAFT_LABEL }}" >> $GITHUB_ENV | ||
| echo "REMOVE_LABEL_VALUE=${{ env.READY_LABEL }}" >> $GITHUB_ENV | ||
| else | ||
| echo "ADD_LABEL_VALUE=${{ env.READY_LABEL }}" >> $GITHUB_ENV | ||
| echo "REMOVE_LABEL_VALUE=${{ env.DRAFT_LABEL }}" >> $GITHUB_ENV | ||
| fi | ||
|
|
||
| - name: Add/Remove PR labels based on event type | ||
| shell: bash | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| PR_NUMBER: ${{ github.event.pull_request.number }} | ||
| REPO: ${{ github.repository }} | ||
| EVENT_ACTION: ${{ github.event.action }} | ||
| ADD_LABEL: ${{ env.ADD_LABEL_VALUE }} | ||
| REMOVE_LABEL: ${{ env.REMOVE_LABEL_VALUE }} | ||
| run: *update_run | ||
|
||
|
|
||
| close-remove-labels: | ||
| if: github.event.action == 'closed' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Add/Remove PR labels based on event type | ||
| shell: bash | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| PR_NUMBER: ${{ github.event.pull_request.number }} | ||
| REPO: ${{ github.repository }} | ||
| EVENT_ACTION: ${{ github.event.action }} | ||
| run: | | ||
| gh pr edit "$PR_NUMBER" --repo "$REPO" --remove-label "${{ env.DRAFT_LABEL }}" || true | ||
| gh pr edit "$PR_NUMBER" --repo "$REPO" --remove-label "${{ env.READY_LABEL }}" || true | ||
| echo "Removed labels based on event action: $EVENT_ACTION for PR #$PR_NUMBER" >> "$GITHUB_STEP_SUMMARY" | ||
Check notice
Code scanning / Opengrep OSS
Non-deterministic Node.js version in actions/setup-node Note