0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-08-23 03:48:35 +00:00

chore(ci): add link checker, reformat actions code (#944)

* chore(ci): add link checker, reformat actions code

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>

* chore: use bot app token

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>

---------

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
This commit is contained in:
Pavel Boldyrev 2024-01-20 22:43:08 -05:00 committed by GitHub
parent b926c57a53
commit a030542da0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 77 additions and 40 deletions

View File

@ -15,7 +15,6 @@ jobs:
golangci-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
@ -34,7 +33,7 @@ jobs:
uses: actions/setup-go@v5
if: steps.filter.outputs.go == 'true'
with:
go-version-file: 'go.mod'
go-version-file: "go.mod"
- name: Lint code
if: steps.filter.outputs.go == 'true'

46
.github/workflows/link-check.yml vendored Normal file
View File

@ -0,0 +1,46 @@
name: "Link Check"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * 0"
jobs:
link-check:
runs-on: ubuntu-latest
steps:
- name: Generate Short Lived OAuth App Token
uses: actions/create-github-app-token@c4fa18d55c5d49e6a2793e351ea4938322c61072 # v1.6.4
id: app-token
with:
app-id: "${{ secrets.BOT_APP_ID }}"
private-key: "${{ secrets.BOT_APP_PRIVATE_KEY }}"
owner: "${{ github.repository_owner }}"
repositories: "${{ github.event.repository.name }}"
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Link Checker
uses: lycheeverse/lychee-action@c3089c702fbb949e3f7a8122be0c33c017904f9b # v1.9.1
id: lychee
env:
GITHUB_TOKEN: "${{ steps.app-token.outputs.token }}"
- name: Find Link Checker Issue
id: link-checker-issue
uses: micalevisk/last-issue-action@0d40124cc99ac8601c2516007f0c98ef3d27537b # v2.3.0
with:
state: open
labels: |
broken-links
- name: Update Issue
uses: peter-evans/create-issue-from-file@433e51abf769039ee20ba1293a088ca19d573b7f # renovate: tag=v4.0.1
with:
title: Broken links detected 🔗
issue-number: "${{ steps.link-checker-issue.outputs.issue-number }}"
content-filepath: ./lychee/out.md
token: "${{ steps.app-token.outputs.token }}"
labels: |
broken-links

View File

@ -4,8 +4,8 @@ on:
schedule:
- cron: "0 0 * * *" # every day at 00:00 UTC (8pm EST)
workflow_dispatch:
push:
branches:
push:
branches:
- "main"
jobs:
@ -14,20 +14,18 @@ jobs:
permissions:
contents: write
steps:
- name: Generate Metrics
uses: lowlighter/metrics@latest
with:
template: repository
filename: metrics.svg
user: bpg
repo: terraform-provider-proxmox
token: "${{ secrets.METRICS_TOKEN }}"
output_action: gist
committer_gist: 2cc44ead81225542ed1ef0303d8f9eb9
plugin_lines: yes
plugin_followup: yes
plugin_stargazers: yes
plugin_stargazers_days: 365
plugin_stargazers_charts_type: graph
template: repository
filename: metrics.svg
user: bpg
repo: terraform-provider-proxmox
token: "${{ secrets.METRICS_TOKEN }}"
output_action: gist
committer_gist: 2cc44ead81225542ed1ef0303d8f9eb9
plugin_lines: yes
plugin_followup: yes
plugin_stargazers: yes
plugin_stargazers_days: 365
plugin_stargazers_charts_type: graph

View File

@ -11,13 +11,12 @@ name: Publish Release
on:
push:
tags:
- 'v*'
- "v*"
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Generate Short Lived OAuth App Token
uses: actions/create-github-app-token@c4fa18d55c5d49e6a2793e351ea4938322c61072 # v1.6.4
id: app-token
@ -32,11 +31,11 @@ jobs:
- name: Unshallow
run: git fetch --prune --unshallow
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
go-version-file: "go.mod"
- name: Import GPG key
id: import_gpg

View File

@ -12,7 +12,6 @@ jobs:
permissions:
contents: write
steps:
- name: Generate Short Lived OAuth App Token
uses: actions/create-github-app-token@c4fa18d55c5d49e6a2793e351ea4938322c61072 # v1.6.4
id: app-token

View File

@ -1,15 +1,15 @@
name: Semgrep
on:
on:
pull_request: {}
push:
branches:
- main
- main
paths:
- .github/workflows/semgrep.yml
- .github/workflows/semgrep.yml
schedule:
# random HH:MM to avoid a load spike on GitHub Actions at 00:00
- cron: 29 16 * * *
# random HH:MM to avoid a load spike on GitHub Actions at 00:00
- cron: 29 16 * * *
jobs:
semgrep:
@ -19,9 +19,8 @@ jobs:
container:
image: returntocorp/semgrep
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
- name: Semgrep
run: semgrep ci
- name: Semgrep
run: semgrep ci

View File

@ -11,7 +11,6 @@ jobs:
issues: write
pull-requests: write
steps:
- name: Generate Short Lived OAuth App Token
uses: actions/create-github-app-token@c4fa18d55c5d49e6a2793e351ea4938322c61072 # v1.6.4
id: app-token
@ -27,8 +26,8 @@ jobs:
repo-token: "${{ steps.app-token.outputs.token }}"
days-before-stale: 180
days-before-close: 30
exempt-issue-labels: 'needs-triage, acknowledged, in-progress'
exempt-pr-labels: 'needs-review, under-review, acknowledged, planned'
exempt-issue-labels: "needs-triage, acknowledged, in-progress"
exempt-pr-labels: "needs-review, under-review, acknowledged, planned"
remove-stale-when-updated: true
delete-branch: false
stale-issue-label: stale

View File

@ -11,7 +11,6 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
with:
@ -29,7 +28,7 @@ jobs:
if: steps.filter.outputs.go == 'true'
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
go-version-file: "go.mod"
- name: Get dependencies
if: steps.filter.outputs.go == 'true'
@ -43,7 +42,6 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
@ -61,7 +59,7 @@ jobs:
if: steps.filter.outputs.go == 'true'
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
go-version-file: "go.mod"
- name: Get dependencies
if: steps.filter.outputs.go == 'true'