Skip to content

Commit

Permalink
chore: update workflow check-conventional-commits
Browse files Browse the repository at this point in the history
Updates the workflow to deal with the fact that ``` in the github.event
leading to code execution
  • Loading branch information
staaldraad committed Sep 25, 2024
1 parent 9d23c3d commit b844cc7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/conventional-commits-lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const ALLOWED_CONVENTIONAL_COMMIT_PREFIXES = [
];

const object = process.argv[2];
const payload = JSON.parse(fs.readFileSync(process.stdin.fd, "utf-8"));
const payload = JSON.parse(fs.readFileSync(process.argv[3], "utf-8"));

let validate = [];

Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/conventional-commits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,14 @@ jobs:
- if: ${{ github.event_name == 'pull_request_target' }}
run: |
set -ex
node .github/workflows/conventional-commits-lint.js pr <<EOF
${{ toJSON(github.event) }}
EOF
TMP_FILE=$(mktemp)
echo '${{ toJSON(github.event) }}' > "$TMP_FILE"
node .github/workflows/conventional-commits-lint.js pr "$TMP_FILE"
- if: ${{ github.event_name == 'push' }}
run: |
set -ex
node .github/workflows/conventional-commits-lint.js push <<EOF
${{ toJSON(github.event) }}
EOF
TMP_FILE=$(mktemp)
echo '${{ toJSON(github.event) }}' > "$TMP_FILE"
node .github/workflows/conventional-commits-lint.js push "$TMP_FILE"

0 comments on commit b844cc7

Please sign in to comment.