Skip to content

Commit 369ab07

Browse files
authored
(MAINT) Apply yaml formatting to GitHub Actions workflows (#490)
- Added yamlfix action to format YAML files in GitHub Actions workflows. - Updated various YAML files to ensure consistent formatting.
1 parent a224836 commit 369ab07

23 files changed

+534
-792
lines changed

.github/dependabot.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
---
12
version: 2
23
updates:
34
# Maintain dependencies for GitHub Actions
45
- package-ecosystem: github-actions
5-
directory: "/"
6+
directory: /
67
schedule:
78
interval: daily
8-
time: "13:00"
9+
time: 13:00
910
open-pull-requests-limit: 10

.github/workflows/add-to-project.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1+
---
12
name: Add new issue to Solarch project
2-
33
on:
44
issues:
5-
types:
6-
- opened
7-
5+
types: [opened]
86
jobs:
97
add-to-project:
108
name: Add issue to project

.github/workflows/auto_release.yml

+54-63
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,62 @@
1-
name: "Auto release"
2-
1+
---
2+
name: Auto release
33
on:
44
workflow_dispatch:
5-
65
env:
76
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8-
97
jobs:
108
auto_release:
11-
name: "Automatic release prep"
9+
name: Automatic release prep
1210
runs-on: ubuntu-20.04
13-
1411
steps:
15-
- name: "Checkout Source"
16-
if: ${{ github.repository_owner == 'puppetlabs' }}
17-
uses: actions/checkout@v4
18-
with:
19-
fetch-depth: 0
20-
persist-credentials: false
21-
22-
- name: "PDK Release prep"
23-
uses: docker://puppet/puppet-dev-tools:4.x
24-
with:
25-
args: 'pdk release prep --force --debug'
26-
env:
27-
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28-
29-
- name: "Get Version"
30-
if: ${{ github.repository_owner == 'puppetlabs' }}
31-
id: gv
32-
run: |
33-
echo "::set-output name=ver::$(jq --raw-output .version metadata.json)"
34-
35-
- name: "Check if a release is necessary"
36-
if: ${{ github.repository_owner == 'puppetlabs' }}
37-
id: check
38-
run: |
39-
git diff --quiet CHANGELOG.md && echo "::set-output name=release::false" || echo "::set-output name=release::true"
40-
41-
- name: "Commit changes"
42-
if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
43-
run: |
44-
git config --local user.email "${{ github.repository_owner }}@users.noreply.github.com"
45-
git config --local user.name "GitHub Action"
46-
git add .
47-
git commit -m "Release prep v${{ steps.gv.outputs.ver }}"
48-
49-
- name: Create Pull Request
50-
id: cpr
51-
uses: puppetlabs/peter-evans-create-pull-request@v3
52-
if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
53-
with:
54-
token: ${{ secrets.GITHUB_TOKEN }}
55-
commit-message: "Release prep v${{ steps.gv.outputs.ver }}"
56-
branch: "release-prep"
57-
delete-branch: true
58-
title: "Release prep v${{ steps.gv.outputs.ver }}"
59-
body: |
60-
Automated release-prep through [pdk-templates](https://github.com/puppetlabs/pdk-templates/blob/main/moduleroot/.github/workflows/auto_release.yml.erb) from commit ${{ github.sha }}.
61-
Please verify before merging:
62-
- [ ] last [nightly](https://github.com/${{ github.repository }}/actions/workflows/nightly.yml) run is green
63-
- [ ] [Changelog](https://github.com/${{ github.repository }}/blob/release-prep/CHANGELOG.md) is readable and has no unlabeled pull requests
64-
- [ ] Ensure the [changelog](https://github.com/${{ github.repository }}/blob/release-prep/CHANGELOG.md) version and [metadata](https://github.com/${{ github.repository }}/blob/release-prep/metadata.json) version match
65-
labels: "maintenance"
66-
67-
- name: PR outputs
68-
if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
69-
run: |
70-
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
71-
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
12+
- name: Checkout Source
13+
if: ${{ github.repository_owner == 'puppetlabs' }}
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
persist-credentials: false
18+
- name: PDK Release prep
19+
uses: docker://puppet/puppet-dev-tools:4.x
20+
with:
21+
args: pdk release prep --force --debug
22+
env:
23+
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
- name: Get Version
25+
if: ${{ github.repository_owner == 'puppetlabs' }}
26+
id: gv
27+
run: |
28+
echo "::set-output name=ver::$(jq --raw-output .version metadata.json)"
29+
- name: Check if a release is necessary
30+
if: ${{ github.repository_owner == 'puppetlabs' }}
31+
id: check
32+
run: |
33+
git diff --quiet CHANGELOG.md && echo "::set-output name=release::false" || echo "::set-output name=release::true"
34+
- name: Commit changes
35+
if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
36+
run: |
37+
git config --local user.email "${{ github.repository_owner }}@users.noreply.github.com"
38+
git config --local user.name "GitHub Action"
39+
git add .
40+
git commit -m "Release prep v${{ steps.gv.outputs.ver }}"
41+
- name: Create Pull Request
42+
id: cpr
43+
uses: puppetlabs/peter-evans-create-pull-request@v3
44+
if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
45+
with:
46+
token: ${{ secrets.GITHUB_TOKEN }}
47+
commit-message: Release prep v${{ steps.gv.outputs.ver }}
48+
branch: release-prep
49+
delete-branch: true
50+
title: Release prep v${{ steps.gv.outputs.ver }}
51+
body: |
52+
Automated release-prep through [pdk-templates](https://github.com/puppetlabs/pdk-templates/blob/main/moduleroot/.github/workflows/auto_release.yml.erb) from commit ${{ github.sha }}.
53+
Please verify before merging:
54+
- [ ] last [nightly](https://github.com/${{ github.repository }}/actions/workflows/nightly.yml) run is green
55+
- [ ] [Changelog](https://github.com/${{ github.repository }}/blob/release-prep/CHANGELOG.md) is readable and has no unlabeled pull requests
56+
- [ ] Ensure the [changelog](https://github.com/${{ github.repository }}/blob/release-prep/CHANGELOG.md) version and [metadata](https://github.com/${{ github.repository }}/blob/release-prep/metadata.json) version match
57+
labels: maintenance
58+
- name: PR outputs
59+
if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
60+
run: |-
61+
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
62+
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"

.github/workflows/ci.yml

+8-11
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
1-
name: "ci"
2-
1+
---
2+
name: ci
33
on:
44
pull_request:
5-
branches:
6-
- "main"
5+
branches: [main]
76
workflow_dispatch:
8-
97
jobs:
108
Spec:
119
if: ${{ github.repository_owner == 'puppetlabs' }}
12-
uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main"
13-
secrets: "inherit"
14-
10+
uses: puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main
11+
secrets: inherit
1512
Acceptance:
1613
if: ${{ github.repository_owner == 'puppetlabs' }}
1714
needs: Spec
18-
uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main"
15+
uses: puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main
1916
with:
20-
flags: "--provision-service"
21-
secrets: "inherit"
17+
flags: --provision-service
18+
secrets: inherit

.github/workflows/mend.yml

+9-11
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1-
name: "mend"
2-
1+
---
2+
name: mend
33
on:
44
pull_request:
5-
types:
6-
- closed
7-
branches:
8-
- "main"
5+
types: [closed]
6+
branches: [main]
97
schedule:
10-
- cron: "0 0 * * *"
8+
- cron: 0 0 * * *
119
workflow_dispatch:
12-
1310
jobs:
1411
mend:
15-
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || (github.event.pull_request.merged == true && github.ref == 'refs/heads/main')
16-
uses: "puppetlabs/cat-github-actions/.github/workflows/tooling_mend_ruby.yml@main"
17-
secrets: "inherit"
12+
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
13+
|| (github.event.pull_request.merged == true && github.ref == 'refs/heads/main')
14+
uses: puppetlabs/cat-github-actions/.github/workflows/tooling_mend_ruby.yml@main
15+
secrets: inherit
1816
with:
1917
product_name: InsTalleR

.github/workflows/nightly.yml

+8-10
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1-
name: "nightly"
2-
1+
---
2+
name: nightly
33
on:
44
schedule:
5-
- cron: "0 0 * * *"
5+
- cron: 0 0 * * *
66
workflow_dispatch:
7-
87
jobs:
98
Spec:
109
if: ${{ github.repository_owner == 'puppetlabs' }}
11-
uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main"
12-
secrets: "inherit"
13-
10+
uses: puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main
11+
secrets: inherit
1412
Acceptance:
1513
if: ${{ github.repository_owner == 'puppetlabs' }}
1614
needs: Spec
17-
uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main"
15+
uses: puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main
1816
with:
19-
flags: "--provision-service"
20-
secrets: "inherit"
17+
flags: --provision-service
18+
secrets: inherit

.github/workflows/release-prep.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
name: "Release Prep"
2-
1+
---
2+
name: Release Prep
33
on:
44
workflow_dispatch:
55
inputs:
66
version:
7-
description: "Module version to be released. Must be a valid semver string. (1.2.3)"
7+
description: Module version to be released. Must be a valid semver string.
8+
(1.2.3)
89
required: true
9-
1010
jobs:
1111
release_prep:
12-
uses: "puppetlabs/cat-github-actions/.github/workflows/module_release_prep.yml@main"
12+
uses: puppetlabs/cat-github-actions/.github/workflows/module_release_prep.yml@main
1313
with:
14-
version: "${{ github.event.inputs.version }}"
15-
secrets: "inherit"
14+
version: ${{ github.event.inputs.version }}
15+
secrets: inherit

.github/workflows/release.yml

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
name: "Publish module"
2-
1+
---
2+
name: Publish module
33
on:
44
workflow_dispatch:
5-
65
jobs:
7-
release:
8-
uses: "puppetlabs/cat-github-actions/.github/workflows/module_release.yml@main"
9-
secrets: "inherit"
6+
release:
7+
uses: puppetlabs/cat-github-actions/.github/workflows/module_release.yml@main
8+
secrets: inherit

0 commit comments

Comments
 (0)