Skip to content

Commit

Permalink
(MAINT) Apply yaml formatting to GitHub Actions workflows (#490)
Browse files Browse the repository at this point in the history
- Added yamlfix action to format YAML files in GitHub Actions workflows.
- Updated various YAML files to ensure consistent formatting.
  • Loading branch information
CoMfUcIoS authored Sep 5, 2024
1 parent a224836 commit 369ab07
Show file tree
Hide file tree
Showing 23 changed files with 534 additions and 792 deletions.
5 changes: 3 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: github-actions
directory: "/"
directory: /
schedule:
interval: daily
time: "13:00"
time: 13:00
open-pull-requests-limit: 10
6 changes: 2 additions & 4 deletions .github/workflows/add-to-project.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
---
name: Add new issue to Solarch project

on:
issues:
types:
- opened

types: [opened]
jobs:
add-to-project:
name: Add issue to project
Expand Down
117 changes: 54 additions & 63 deletions .github/workflows/auto_release.yml
Original file line number Diff line number Diff line change
@@ -1,71 +1,62 @@
name: "Auto release"

---
name: Auto release
on:
workflow_dispatch:

env:
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
auto_release:
name: "Automatic release prep"
name: Automatic release prep
runs-on: ubuntu-20.04

steps:
- name: "Checkout Source"
if: ${{ github.repository_owner == 'puppetlabs' }}
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

- name: "PDK Release prep"
uses: docker://puppet/puppet-dev-tools:4.x
with:
args: 'pdk release prep --force --debug'
env:
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: "Get Version"
if: ${{ github.repository_owner == 'puppetlabs' }}
id: gv
run: |
echo "::set-output name=ver::$(jq --raw-output .version metadata.json)"
- name: "Check if a release is necessary"
if: ${{ github.repository_owner == 'puppetlabs' }}
id: check
run: |
git diff --quiet CHANGELOG.md && echo "::set-output name=release::false" || echo "::set-output name=release::true"
- name: "Commit changes"
if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
run: |
git config --local user.email "${{ github.repository_owner }}@users.noreply.github.com"
git config --local user.name "GitHub Action"
git add .
git commit -m "Release prep v${{ steps.gv.outputs.ver }}"
- name: Create Pull Request
id: cpr
uses: puppetlabs/peter-evans-create-pull-request@v3
if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Release prep v${{ steps.gv.outputs.ver }}"
branch: "release-prep"
delete-branch: true
title: "Release prep v${{ steps.gv.outputs.ver }}"
body: |
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 }}.
Please verify before merging:
- [ ] last [nightly](https://github.com/${{ github.repository }}/actions/workflows/nightly.yml) run is green
- [ ] [Changelog](https://github.com/${{ github.repository }}/blob/release-prep/CHANGELOG.md) is readable and has no unlabeled pull requests
- [ ] 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
labels: "maintenance"

- name: PR outputs
if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
- name: Checkout Source
if: ${{ github.repository_owner == 'puppetlabs' }}
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: PDK Release prep
uses: docker://puppet/puppet-dev-tools:4.x
with:
args: pdk release prep --force --debug
env:
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get Version
if: ${{ github.repository_owner == 'puppetlabs' }}
id: gv
run: |
echo "::set-output name=ver::$(jq --raw-output .version metadata.json)"
- name: Check if a release is necessary
if: ${{ github.repository_owner == 'puppetlabs' }}
id: check
run: |
git diff --quiet CHANGELOG.md && echo "::set-output name=release::false" || echo "::set-output name=release::true"
- name: Commit changes
if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
run: |
git config --local user.email "${{ github.repository_owner }}@users.noreply.github.com"
git config --local user.name "GitHub Action"
git add .
git commit -m "Release prep v${{ steps.gv.outputs.ver }}"
- name: Create Pull Request
id: cpr
uses: puppetlabs/peter-evans-create-pull-request@v3
if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Release prep v${{ steps.gv.outputs.ver }}
branch: release-prep
delete-branch: true
title: Release prep v${{ steps.gv.outputs.ver }}
body: |
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 }}.
Please verify before merging:
- [ ] last [nightly](https://github.com/${{ github.repository }}/actions/workflows/nightly.yml) run is green
- [ ] [Changelog](https://github.com/${{ github.repository }}/blob/release-prep/CHANGELOG.md) is readable and has no unlabeled pull requests
- [ ] 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
labels: maintenance
- name: PR outputs
if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
run: |-
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
19 changes: 8 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
name: "ci"

---
name: ci
on:
pull_request:
branches:
- "main"
branches: [main]
workflow_dispatch:

jobs:
Spec:
if: ${{ github.repository_owner == 'puppetlabs' }}
uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main"
secrets: "inherit"

uses: puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main
secrets: inherit
Acceptance:
if: ${{ github.repository_owner == 'puppetlabs' }}
needs: Spec
uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main"
uses: puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main
with:
flags: "--provision-service"
secrets: "inherit"
flags: --provision-service
secrets: inherit
20 changes: 9 additions & 11 deletions .github/workflows/mend.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
name: "mend"

---
name: mend
on:
pull_request:
types:
- closed
branches:
- "main"
types: [closed]
branches: [main]
schedule:
- cron: "0 0 * * *"
- cron: 0 0 * * *
workflow_dispatch:

jobs:
mend:
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || (github.event.pull_request.merged == true && github.ref == 'refs/heads/main')
uses: "puppetlabs/cat-github-actions/.github/workflows/tooling_mend_ruby.yml@main"
secrets: "inherit"
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
|| (github.event.pull_request.merged == true && github.ref == 'refs/heads/main')
uses: puppetlabs/cat-github-actions/.github/workflows/tooling_mend_ruby.yml@main
secrets: inherit
with:
product_name: InsTalleR
18 changes: 8 additions & 10 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
name: "nightly"

---
name: nightly
on:
schedule:
- cron: "0 0 * * *"
- cron: 0 0 * * *
workflow_dispatch:

jobs:
Spec:
if: ${{ github.repository_owner == 'puppetlabs' }}
uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main"
secrets: "inherit"

uses: puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main
secrets: inherit
Acceptance:
if: ${{ github.repository_owner == 'puppetlabs' }}
needs: Spec
uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main"
uses: puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main
with:
flags: "--provision-service"
secrets: "inherit"
flags: --provision-service
secrets: inherit
14 changes: 7 additions & 7 deletions .github/workflows/release-prep.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: "Release Prep"

---
name: Release Prep
on:
workflow_dispatch:
inputs:
version:
description: "Module version to be released. Must be a valid semver string. (1.2.3)"
description: Module version to be released. Must be a valid semver string.
(1.2.3)
required: true

jobs:
release_prep:
uses: "puppetlabs/cat-github-actions/.github/workflows/module_release_prep.yml@main"
uses: puppetlabs/cat-github-actions/.github/workflows/module_release_prep.yml@main
with:
version: "${{ github.event.inputs.version }}"
secrets: "inherit"
version: ${{ github.event.inputs.version }}
secrets: inherit
11 changes: 5 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: "Publish module"

---
name: Publish module
on:
workflow_dispatch:

jobs:
release:
uses: "puppetlabs/cat-github-actions/.github/workflows/module_release.yml@main"
secrets: "inherit"
release:
uses: puppetlabs/cat-github-actions/.github/workflows/module_release.yml@main
secrets: inherit
Loading

0 comments on commit 369ab07

Please sign in to comment.