-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update workflows to use github-config/library
- Loading branch information
1 parent
41ec9e6
commit b63ede2
Showing
14 changed files
with
358 additions
and
62 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,19 @@ | ||
.github/.patch_files | ||
.github/labels.yml | ||
.github/CODEOWNERS | ||
.github/workflows | ||
.github/workflows/approve-bot-pr.yml | ||
.github/workflows/codeql-analysis.yml | ||
.github/workflows/lint.yml | ||
.github/workflows/update-github-config.yml | ||
.github/workflows/create-draft-release.yml | ||
.github/workflows/test-pull-request.yml | ||
.github/workflows/lint-yaml.yml | ||
.github/workflows/synchronize-labels.yml | ||
.github/workflows/label-pr.yml | ||
.github/.syncignore | ||
.github/dependabot.yml | ||
.gitignore | ||
LICENSE | ||
NOTICE | ||
README.md |
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,3 @@ | ||
workflows/test-pull-request.yml | ||
workflows/create-draft-release.yml | ||
CODEOWNERS |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
version: 2 | ||
updates: | ||
- package-ecosystem: gomod | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
open-pull-requests-limit: 10 |
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,36 @@ | ||
- name: status/possible-priority | ||
description: This issue is ready to work and should be considered as a potential priority | ||
color: F9D0C4 | ||
- name: status/prioritized | ||
description: This issue has been triaged and resolving it is a priority | ||
color: BFD4F2 | ||
- name: status/blocked | ||
description: This issue has been triaged and resolving it is blocked on some other issue | ||
color: 848978 | ||
- name: bug | ||
description: Something isn't working | ||
color: d73a4a | ||
- name: enhancement | ||
description: A new feature or request | ||
color: a2eeef | ||
- name: documentation | ||
description: This issue relates to writing documentation | ||
color: D4C5F9 | ||
- name: semver:major | ||
description: A change requiring a major version bump | ||
color: 6b230e | ||
- name: semver:minor | ||
description: A change requiring a minor version bump | ||
color: cc6749 | ||
- name: semver:patch | ||
description: A change requiring a patch version bump | ||
color: f9d0c4 | ||
- name: good first issue | ||
description: A good first issue to get started with | ||
color: d3fc03 | ||
- name: "failure:release" | ||
description: An issue filed automatically when a release workflow run fails | ||
color: f00a0a | ||
- name: "failure:push" | ||
description: An issue filed automatically when a push buildpackage workflow run fails | ||
color: f00a0a |
2 changes: 1 addition & 1 deletion
2
.github/workflows/approve-bot-prs.yml → .github/workflows/approve-bot-pr.yml
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Approve Bot PRs | ||
name: Approve Bot PRs and Enable Auto-Merge | ||
|
||
on: | ||
workflow_run: | ||
|
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,39 @@ | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- v* | ||
pull_request: | ||
branches: | ||
- main | ||
- v* | ||
schedule: | ||
- cron: '0 0 * * *' # Once a day at midnight | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: | ||
- 'go' | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: ${{ matrix.language }} | ||
|
||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v2 | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 |
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,93 @@ | ||
name: Create or Update Draft Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- v* | ||
repository_dispatch: | ||
types: [ version-bump ] | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Version of the release to cut (e.g. 1.2.3)' | ||
required: false | ||
|
||
concurrency: release | ||
|
||
jobs: | ||
unit: | ||
name: Unit Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.18.x | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Run Unit Tests | ||
run: go test -v -count=1 ./... | ||
|
||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
needs: unit | ||
steps: | ||
- name: Setup Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.18.x | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true | ||
- name: Reset Draft Release | ||
id: reset | ||
uses: paketo-buildpacks/github-config/actions/release/reset-draft@main | ||
with: | ||
repo: ${{ github.repository }} | ||
token: ${{ github.token }} | ||
- name: Calculate Semver Tag | ||
if: github.event.inputs.version == '' | ||
id: semver | ||
uses: paketo-buildpacks/github-config/actions/tag/calculate-semver@main | ||
with: | ||
repo: ${{ github.repository }} | ||
token: ${{ github.token }} | ||
ref-name: ${{ github.ref_name }} | ||
- name: Set Release Tag | ||
id: tag | ||
run: | | ||
tag="${{ github.event.inputs.version }}" | ||
if [ -z "${tag}" ]; then | ||
tag="${{ steps.semver.outputs.tag }}" | ||
fi | ||
echo "::set-output name=tag::${tag}" | ||
- name: Create Release | ||
uses: paketo-buildpacks/github-config/actions/release/create@main | ||
with: | ||
repo: ${{ github.repository }} | ||
token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} | ||
tag_name: v${{ steps.tag.outputs.tag }} | ||
target_commitish: ${{ github.sha }} | ||
name: v${{ steps.tag.outputs.tag }} | ||
draft: true | ||
|
||
failure: | ||
name: Alert on Failure | ||
runs-on: ubuntu-latest | ||
needs: [ unit, release ] | ||
if: ${{ always() && needs.unit.result == 'failure' || needs.release.result == 'failure' }} | ||
steps: | ||
- name: File Failure Alert Issue | ||
uses: paketo-buildpacks/github-config/actions/issue/file@main | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
repo: ${{ github.repository }} | ||
label: "failure:release" | ||
comment_if_exists: true | ||
issue_title: "Failure: Create Draft Release workflow" | ||
issue_body: | | ||
Create Draft Release workflow [failed](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}). | ||
comment_body: | | ||
Another failure occurred: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} |
This file was deleted.
Oops, something went wrong.
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,34 @@ | ||
name: Set / Validate PR Labels | ||
on: | ||
pull_request_target: | ||
branches: | ||
- main | ||
- v* | ||
types: | ||
- synchronize | ||
- opened | ||
- reopened | ||
- labeled | ||
- unlabeled | ||
|
||
concurrency: pr_labels_${{ github.event.number }} | ||
|
||
jobs: | ||
autolabel: | ||
name: Ensure Minimal Semver Labels | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check Minimal Semver Labels | ||
uses: mheap/github-action-required-labels@v1 | ||
with: | ||
count: 1 | ||
labels: semver:major, semver:minor, semver:patch | ||
mode: exactly | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Auto-label Semver | ||
if: ${{ failure() }} | ||
uses: paketo-buildpacks/github-config/actions/pull-request/auto-semver-label@main | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} |
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: Lint Workflows | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- '.github/**.yml' | ||
- '.github/**.yaml' | ||
|
||
jobs: | ||
lintYaml: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Checkout github-config | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: paketo-buildpacks/github-config | ||
path: github-config | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install yamllint | ||
run: pip install yamllint | ||
|
||
- name: Lint YAML files | ||
run: yamllint ./.github -c github-config/.github/.yamllint |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Synchronize Labels | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- v* | ||
paths: | ||
- .github/labels.yml | ||
|
||
jobs: | ||
synchronize: | ||
name: Synchronize Labels | ||
runs-on: | ||
- ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: micnncim/action-label-syncer@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} |
Oops, something went wrong.