-
Notifications
You must be signed in to change notification settings - Fork 190
Sync repo templates ⚙ #4468
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
Open
coreosbot-releng
wants to merge
1
commit into
coreos:main
Choose a base branch
from
coreosbot-releng:repo-templates
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+105
−0
Open
Sync repo templates ⚙ #4468
Changes from all commits
Commits
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 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,46 @@ | ||
| # Maintained in https://github.com/coreos/repo-templates | ||
| # Do not edit downstream. | ||
|
|
||
| name: Go | ||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
| permissions: | ||
| contents: read | ||
|
|
||
| # don't waste job slots on superseded code | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| test: | ||
| name: Test | ||
| strategy: | ||
| matrix: | ||
| go-version: [1.25.x, 1.26.x] | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Set up Go 1.x | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: ${{ matrix.go-version }} | ||
| - name: Check out repository | ||
| uses: actions/checkout@v6 | ||
| - name: Check Go formatting (gofmt) | ||
| shell: bash | ||
| run: | | ||
| GO_FILES=$(find . -name '*.go' -not -path "./vendor/*") | ||
| UNFORMATTED_FILES=$(gofmt -l $GO_FILES) | ||
| if [ -n "$UNFORMATTED_FILES" ]; then | ||
| echo "Go files are not formatted. Please run 'gofmt -w .' on your code." | ||
| gofmt -d $UNFORMATTED_FILES | ||
| exit 1 | ||
| fi | ||
| echo "All Go files are correctly formatted." | ||
| - name: Run linter | ||
| uses: golangci/golangci-lint-action@v8 | ||
| with: | ||
| version: v2.11.3 |
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,24 @@ | ||
| # Template generated by https://github.com/coreos/repo-templates; do not edit downstream | ||
|
|
||
| name: ShellCheck | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main, rhel-*, rhcos-*] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| shellcheck: | ||
| name: Shellcheck | ||
| runs-on: ubuntu-latest | ||
| container: quay.io/coreos-assembler/fcos-buildroot:testing-devel | ||
| steps: | ||
| - name: Check out repository | ||
| uses: actions/checkout@v6 | ||
| # https://github.com/actions/checkout/issues/760 | ||
| - name: Mark git checkout as safe | ||
| run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | ||
| - name: Run ShellCheck | ||
| run: ci/shellcheck |
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,35 @@ | ||
| #!/bin/bash | ||
| # Template generated by https://github.com/coreos/repo-templates; do not edit downstream | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| main() { | ||
| local found_errors="false" | ||
| # Let's start with error, then we can do warning, info, style | ||
| local -r severity="error" | ||
|
|
||
| while IFS= read -r -d '' f; do | ||
| # Skip non-text files that are very unlikely to be shell scripts | ||
| if [[ "$(file -b --mime-type "${f}" | sed 's|/.*||')" != "text" ]]; then | ||
| continue | ||
| fi | ||
| shebang="$(head -1 "${f}")" | ||
| if [[ "${f}" == *.sh ]] || \ | ||
| [[ ${shebang} =~ ^#!/.*/bash.* ]] || \ | ||
| [[ ${shebang} =~ ^#!/.*/env\ bash ]]; then | ||
| echo "[+] Checking ${f}" | ||
| shellcheck --external-sources --shell bash --severity="${severity}" "${f}" || found_errors="true" | ||
| bash -n "${f}" || found_errors="true" | ||
| fi | ||
| done< <(find . -path "./.git" -prune -o -path "./vendor" -prune -o -type f -print0) | ||
|
|
||
| if [[ "${found_errors}" != "false" ]]; then | ||
|
dustymabe marked this conversation as resolved.
|
||
| echo "[+] Found errors with ShellCheck" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "[+] No error found with ShellCheck" | ||
| exit 0 | ||
| } | ||
|
|
||
| main "${@}" | ||
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.