Skip to content

Commit

Permalink
feat: run actionlint for GitHub Actions variant
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed Dec 14, 2023
1 parent 4edfd5b commit c565b36
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,17 @@ jobs:
config_path: 'ackama_rails_template.config.yml'
- name: all
config_path: 'ci/configs/all.yml'
install_actionlint: 'yes'
- name: all-typescript
config_path: 'ci/configs/all-typescript.yml'
install_actionlint: 'yes'
- name: basic
config_path: 'ci/configs/basic.yml'
- name: basic-typescript
config_path: 'ci/configs/basic-typescript.yml'
- name: github_actions
config_path: 'ci/configs/github_actions.yml'
install_actionlint: 'yes'
- name: react
config_path: 'ci/configs/react.yml'
- name: react-typescript
Expand Down Expand Up @@ -129,6 +132,13 @@ jobs:
- name: Check dependencies for vulnerabilities (and setup osv-detector)
uses: g-rath/check-with-osv-detector@main

# this ensures that actionlint is available for running bin/ci-run
- name: Setup ActionLint
if: matrix.variant.install_actionlint == 'yes'
run: |
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
sudo ln -s ./osv-detector /usr/local/bin/actionlint
- name: Install NodeJS
uses: actions/setup-node@v3
with:
Expand Down
10 changes: 10 additions & 0 deletions variants/github_actions_ci/template.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
template "variants/github_actions_ci/workflows/ci.yml.tt", ".github/workflows/ci.yml"
copy_file "variants/github_actions_ci/workflows/deploy_to_ec2.yml", ".github/workflows/deploy_to_ec2.yml"
copy_file "variants/github_actions_ci/workflows/deploy_to_heroku.yml", ".github/workflows/deploy_to_heroku.yml"

append_to_file "bin/ci-run" do
<<~ACTIONLINT
echo "* ******************************************************"
echo "* Running ActionLint"
echo "* ******************************************************"
actionlint
ACTIONLINT
end

0 comments on commit c565b36

Please sign in to comment.