Skip to content

Extend isAuthorized to process current transaction in HAS System Contract #724

Extend isAuthorized to process current transaction in HAS System Contract

Extend isAuthorized to process current transaction in HAS System Contract #724

Workflow file for this run

# This is a github actions workflow that retrieves the modified hips and runs a validator script against them written in Node.
name: Validate HIP
on: [pull_request]
jobs:
ValidateHIP:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "12.x"
- name: Install jq
run: sudo apt-get install jq
- name: Validate HIPs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_NUMBER=${{ github.event.pull_request.number }}
REPO=${{ github.repository }}
PR_DATA=$(curl -s -H "Authorization: token $GITHUB_TOKEN" "https://api.github.com/repos/$REPO/pulls/$PR_NUMBER/files")
MD_FILES=$(echo "$PR_DATA" | jq -r '.[] | select(.filename | test(".md$")) | .filename')
for FILE in $MD_FILES; do
FULL_PATH="${{ github.workspace }}/$FILE"
if [[ -f "$FULL_PATH" ]]; then
node "${{ github.workspace }}/scripts/validateHIP.js" "$FULL_PATH"
else
echo "No file found for $FILE"
exit 1
fi
done