Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
+ name: Prereqs
+ runs-on: ubuntu-24.04
+ steps:
+ - uses: StyraInc/styra-init-action@main
+ - uses: StyraOSS/styra-init-action@main

lint:
name: Analysis & Linting
Expand Down
6 changes: 4 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Styra Init Action'
name: "Styra Init Action"
description: |
This action runs prerequisite checks to ensure that common (pre)requirements are met.
inputs: {}
Expand All @@ -13,11 +13,13 @@ runs:
env:
GITHUB_TOKEN: ${{ github.token }}
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Run Conftest
shell: bash
run: |
WORKFLOW="$(awk -F '[/@]' '{print $3"/"$4"/"$5}' <<< $WORKFLOW_REF)"
mise use -g conftest@0.58.0
conftest test -o github -p "${{ github.action_path }}/policies" $WORKFLOW
env:
WORKFLOW_REF: ${{ github.workflow_ref }}
WORKFLOW_REF: ${{ github.workflow_ref }}
4 changes: 2 additions & 2 deletions policies/actions.rego
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import rego.v1

self := "StyraInc/styra-init-action"
self := "StyraOSS/styra-init-action"

init_job := id if {
some id, job in input.jobs
Expand All @@ -19,7 +19,7 @@ deny contains "workflow does not use init action" if not init_job
deny contains msg if {
some [name, ref] in actions
not is_sha_hash(ref)
lower(name) != "styrainc/styra-init-action" # the only exception, this action itself
lower(name) != "styraoss/styra-init-action" # the only exception, this action itself
msg := sprintf("action %s uses tag %s, should be pinned to SHA hash", [name, ref])
}

Expand Down
Loading