Skip to content

Commit

Permalink
[DevOps] Update Actions to fix check header failed bug in fork repo a…
Browse files Browse the repository at this point in the history
…nd remove useless actions which has moved to devops branch (#2991)

* [DevOps] Update dependabot configure to add scan for remote-config branch

* [DevOps] Update Actions to fix check header failed bug in fork repo and remove useless actions which has moved to devops branch
  • Loading branch information
junw-33455432 authored Jan 25, 2024
1 parent 4e6aed1 commit 2a1521b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 103 deletions.
21 changes: 0 additions & 21 deletions .github/actions/get-branch-name-action/action.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/actions/get-commit-range-action/action.yml

This file was deleted.

23 changes: 0 additions & 23 deletions .github/actions/were-only-docs-updated-action/action.yml

This file was deleted.

37 changes: 3 additions & 34 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,14 @@ on: [pull_request, push]

jobs:
pre-process:
name: Pre process
runs-on: ubuntu-latest
outputs:
were-only-docs-updated: ${{ steps.were-only-docs-updated-action.outputs.were-only-docs-updated }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get commit range
id: get-commit-range-action
uses: ./.github/actions/get-commit-range-action
- name: Were only docs updated
id: were-only-docs-updated-action
uses: ./.github/actions/were-only-docs-updated-action
with:
commit-range: ${{ steps.get-commit-range-action.outputs.commit-range }}
name: Pre-process
uses: vmware/singleton/.github/workflows/pre-process.yml@devops

check-header:
name: Check Header
runs-on: ubuntu-latest
needs: pre-process
if: needs.pre-process.outputs.were-only-docs-updated != 'yes'
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 2.
- name: Get commit range
id: get-commit-range-action
uses: ./.github/actions/get-commit-range-action
- name: Check header
run: |
git clone --branch=devops https://github.com/vmware/singleton.git devops
cp $GITHUB_WORKSPACE/devops/check_headers.py .
chmod +x check_headers.py
git diff ${{ steps.get-commit-range-action.outputs.commit-range }} --stat
git diff --name-only --diff-filter=d ${{ steps.get-commit-range-action.outputs.commit-range }}
python ./check_headers.py -f "$(git diff --name-only --diff-filter=d ${{ steps.get-commit-range-action.outputs.commit-range }})"
uses: vmware/singleton/.github/workflows/check.yml@devops

unit-test:
name: Unit Test
Expand Down

0 comments on commit 2a1521b

Please sign in to comment.