Skip to content

using secret token

using secret token #42

Workflow file for this run

name: Format, Lint and add changes
on:
pull_request:
types:
- opened
- edited
branches:
- main
push:
branches:
- main
permissions:
contents: write
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Setup repo
uses: actions/checkout@v4
- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: Switch branch
run: |
HEAD_REF="${{ github.head_ref }}"
if [ "$HEAD_REF" != "" && "$HEAD_REF" != "main" ]; then
git fetch origin $HEAD_REF
git switch $HEAD_REF
fi
- name: Run linter
run: deno task lint
- name: Verify formatting
run: deno task fmt
- name: Upload changes to base branch
run: |
HEAD_REF="${{ github.head_ref }}"
BRANCH_TO_PUSH="${HEAD_REF:-main}"
git config user.name "github-actions"
git config user.email "[email protected]"
git commit -am "deno formatting"
git push https://x-access-token:${{ secrets.AWSF_PUSH_MAIN }}@github.com/${{ github.repository }} "$BRANCH_TO_PUSH"