Skip to content

Adding New rule

Adding New rule #3

# Update the hisoty.json file with created and modified dates for added/updated rules
name: Update-History
# Controls when the action will run.
on:
# Triggers the workflow on pull request events but only for the main branch
pull_request:
branches: [ main ]
pull_request_target:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.head_ref }}
# Runs a single command using the runners shell
- name: Run a one-line script
run: echo home folder is ${HOME}
- name: Expose git commit data
uses: rlespinasse/[email protected]
- name: get changed file details
uses: lots0logs/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Use Node.js
uses: actions/setup-node@v1
- name: run node script to update history
run: |
cd scripts/update-history
npm install
node .
- name: commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: auto-update history file
push_options: --force