Skip to content

Actually fix actions #73

Actually fix actions

Actually fix actions #73

name: Parse Submission
on:
push:
branches:
- main
paths-ignore:
- 'shipixen/data/stats.js'
jobs:
check-commit-message:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Check commit message
id: check
run: |
COMMIT_MESSAGE=$(git log -1 --pretty=%B)
if [[ "$COMMIT_MESSAGE" == "Update repository stars" || "$COMMIT_MESSAGE" == "Update app info" ]]; then
echo "skip=true" >> $GITHUB_ENV
else
echo "skip=false" >> $GITHUB_ENV
update-app-info:
runs-on: ubuntu-latest
if: env.skip != 'true'

Check failure on line 28 in .github/workflows/parse-submission.yml

View workflow run for this annotation

GitHub Actions / Parse Submission

Invalid workflow file

The workflow is not valid. .github/workflows/parse-submission.yml (Line: 28, Col: 9): Unrecognized named-value: 'env'. Located at position 1 within expression: env.skip != 'true' .github/workflows/parse-submission.yml (Line: 57, Col: 9): Unrecognized named-value: 'env'. Located at position 1 within expression: env.skip != 'true'
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Install dependencies
run: cd shipixen && npm install
- name: Run update script
run: cd shipixen/scripts && node parse-app-info.js
- name: Commit and push changes
if: ${{ success() }}
env:
GITHUB_TOKEN: ${{ secrets.RBD_GITHUB_TOKEN }}
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit -m 'Update app info'
git push https://x-access-token:${{ secrets.RBD_GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
update-stars:
runs-on: ubuntu-latest
if: env.skip != 'true'
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get repository stars
id: get_stars
run: |
STARS=$(curl -s https://api.github.com/repos/${{ github.repository }} | jq .stargazers_count)
echo "stars=$STARS" >> $GITHUB_ENV
- name: Write stars to stats.js
run: |
echo "module.exports = { stars: ${{ env.stars }} };" > shipixen/data/stats.js
- name: Commit changes
env:
GITHUB_TOKEN: ${{ secrets.RBD_GITHUB_TOKEN }}
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add shipixen/data/stats.js
git commit -m 'Update repository stars'
git push https://x-access-token:${{ secrets.RBD_GITHUB_TOKEN }}@github.com/${{ github.repository }}.git