Skip to content

Commit

Permalink
Merge pull request #19 from Hasnep/add-ratchet-for-github-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Hasnep authored Nov 30, 2024
2 parents 6ab37bc + 6f990ba commit d5da596
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 16 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
contents: write
steps:
- name: Check out the repository
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
- name: Install Roc
uses: hasnep/setup-roc@main
uses: hasnep/setup-roc@80f4b4a1b94a7a89b3152e9b4e635367e7c0a940 # ratchet:hasnep/setup-roc@main
with:
roc-version: nightly
- name: Bundle and release the library
uses: hasnep/[email protected]
uses: hasnep/bundle-roc-library@4364d15b4ae83c99e0bc0caab8a254a5d0a9369f # ratchet:hasnep/bundle-roc-library@v0.1.0
with:
library: src/main.roc
token: ${{ github.token }}
4 changes: 2 additions & 2 deletions .github/workflows/check-pr-labels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check for PR category labels
uses: yogevbd/[email protected]
uses: yogevbd/enforce-label-action@a3c219da6b8fa73f6ba62b68ff09c469b3a1c024 # ratchet:yogevbd/enforce-label-action@2.2.2
with:
REQUIRED_LABELS_ANY: feature,fix,chore
REQUIRED_LABELS_ANY_DESCRIPTION: Please tag your PR with one of `feature`, `fix`, or `chore`.
- name: Check for PR version labels
uses: yogevbd/[email protected]
uses: yogevbd/enforce-label-action@a3c219da6b8fa73f6ba62b68ff09c469b3a1c024 # ratchet:yogevbd/enforce-label-action@2.2.2
with:
REQUIRED_LABELS_ANY: major,minor,patch
REQUIRED_LABELS_ANY_DESCRIPTION: Please tag your PR with one of `major`, `minor`, `patch`.
8 changes: 4 additions & 4 deletions .github/workflows/generate-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
id-token: write
steps:
- name: Check out the repository
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
- name: Install Roc
uses: hasnep/setup-roc@main
uses: hasnep/setup-roc@80f4b4a1b94a7a89b3152e9b4e635367e7c0a940 # ratchet:hasnep/setup-roc@main
with:
roc-version: nightly
- name: Generate docs
Expand All @@ -26,8 +26,8 @@ jobs:
run: |
find generated-docs/ -type f -name '*.html' -exec sed -i "s/\(href\|src\)=\"\//\1=\"\/${{ github.event.repository.name }}\//g" {} +
- name: Upload docs artifact
uses: actions/upload-pages-artifact@v3
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # ratchet:actions/upload-pages-artifact@v3
with:
path: generated-docs
- name: Deploy docs
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # ratchet:actions/deploy-pages@v4
8 changes: 4 additions & 4 deletions .github/workflows/run-pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v16
uses: DeterminateSystems/nix-installer-action@e50d5f73bfe71c2dd0aa4218de8f4afa59f8f81d # ratchet:DeterminateSystems/nix-installer-action@v16
- name: Cache Nix environment
uses: DeterminateSystems/magic-nix-cache-action@v8
uses: DeterminateSystems/magic-nix-cache-action@87b14cf437d03d37989d87f0fa5ce4f5dc1a330b # ratchet:DeterminateSystems/magic-nix-cache-action@v8
- name: Use Nix dev shell for subsequent steps
uses: rrbutani/use-nix-shell-action@v1
uses: rrbutani/use-nix-shell-action@59a52b2b9bbfe3cc0e7deb8f9059abe37a439edf # ratchet:rrbutani/use-nix-shell-action@v1
with:
extraNixOptions: --accept-flake-config
- name: Run Pre-commit
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
contents: write
steps:
- name: Check out the repository
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
- name: Install Roc
uses: hasnep/setup-roc@main
uses: hasnep/setup-roc@80f4b4a1b94a7a89b3152e9b4e635367e7c0a940 # ratchet:hasnep/setup-roc@main
with:
roc-version: nightly
- name: Test the library
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-draft-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
steps:
- name: Update the draft release
id: update-draft-release
uses: release-drafter/release-drafter@v6
uses: release-drafter/release-drafter@3f0f87098bd6b5c5b9a36d49c41d998ea58f9348 # ratchet:release-drafter/release-drafter@v6
with:
config-name: release-drafter.yaml
disable-autolabeler: true
Expand Down
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ repos:
entry: actionlint
types: [yaml]
files: \.github/workflows/.*\.ya?ml$
- name: Check GitHub Actions are pinned
id: github-workflows-check-pinned
language: system
entry: ratchet check
types: [yaml]
files: \.github/workflows/.*\.ya?ml$

# Nix
- repo: local
Expand Down
3 changes: 3 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ examples:

docs:
roc docs src/main.roc

ratchet:
ratchet upgrade .github/workflows/*.yaml
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
pkgs.nodePackages.prettier
pkgs.pre-commit
pkgs.python312Packages.pre-commit-hooks
pkgs.ratchet
];
shellHook = "pre-commit install --overwrite";
};
Expand Down

0 comments on commit d5da596

Please sign in to comment.