Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
500Foods authored May 18, 2024
1 parent 262eaac commit e978ffb
Showing 1 changed file with 7 additions and 29 deletions.
36 changes: 7 additions & 29 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,33 @@
name: Count Lines of Code

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
other_job:
runs-on: ubuntu-latest

steps:
- name: Trigger Build Linux x64 Action
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.GH_TOKEN }}
event-type: build_linux_x64

- name: Wait for Build Linux x64 Action to complete
uses: fountainhead/action-wait-for-check@v1.0.0
with:
token: ${{ secrets.GH_TOKEN }}
checkName: build
ref: ${{ github.sha }}

build_linux_x64:
name: Build Linux 64-bit
uses: ./.github/workflows/Build-Linux-x64.yml
secrets: inherit

cloc:
# The type of runner that the job will run on
runs-on: ubuntu-latest
needs: build_linux_x64

permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write

# 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@v3

# Runs djdefi/cloc-action
- name: Count Lines of Code (cloc)
uses: djdefi/cloc-action@main
with:
options: --report-file=cloc.txt

# Copy the new cloc.txt contents into the README.md file at the appropriate spot
- run: csplit README.md /\<\!--CLOC/ {1}
- run: cp xx00 README.md
- run: echo "<!--CLOC-START -->" >> README.md
Expand All @@ -59,7 +38,6 @@ jobs:
- run: echo "\`\`\`" >> README.md
- run: cat xx02 >> README.md

# Save the output back to the repository
- uses: stefanzweifel/git-auto-commit-action@v4
with:
skip_dirty_check: true
Expand Down

0 comments on commit e978ffb

Please sign in to comment.