Skip to content

Commit

Permalink
[FSMCPB-152082] Migrate to GHA 2 (#167)
Browse files Browse the repository at this point in the history
* [FSMCPB-152082] Migrate to GHA 2

* minor changes
  • Loading branch information
zaheral authored Oct 31, 2024
1 parent f4c2bcc commit 7810c38
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/fsh-shell_pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,28 @@ on:
branches: [master]

jobs:
ensure-mandatory-files:
runs-on: ubuntu-latest
continue-on-error: true # Some changes are only relevant for the documentation page
steps:
- uses: actions/checkout@v4
- name: Check
env:
REQUIRED_FILES: CHANGELOG.md package.json package-lock.json
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
FILES_CHANGED=$(git diff --diff-filter='AMTCR' --name-only origin/master HEAD | tr '[:upper:]' '[:lower:]')
echo $FILES_CHANGED
array=( $REQUIRED_FILES )
missing_files=""
for i in "${array[@]}"
do
[[ ${FILES_CHANGED[*]} =~ $i ]] && echo "$i file found in the changeset" || missing_files="$missing_files $i"
done
echo ""
[ -z "$missing_files" ] && echo "All mandatory files have been modified" || echo "Following files $missing_files have not been modified"
[ -z "$missing_files" ] && exit 0 || exit 1
test:
runs-on: ubuntu-latest
steps:
Expand Down
24 changes: 1 addition & 23 deletions .github/workflows/fsh-shell_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,6 @@ on:
branches: [master]

jobs:
ensure-mandatory-files:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check
env:
REQUIRED_FILES: CHANGELOG.md package.json package-lock.json
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
FILES_CHANGED=$(git diff --diff-filter='AMTCR' --name-only origin/master HEAD | tr '[:upper:]' '[:lower:]')
echo $FILES_CHANGED
array=( $REQUIRED_FILES )
missing_files=""
for i in "${array[@]}"
do
[[ ${FILES_CHANGED[*]} =~ $i ]] && echo "$i file found in the changeset" || missing_files="$missing_files $i"
done
echo ""
[ -z "$missing_files" ] && echo "All mandatory files have been modified" || echo "Following files $missing_files have not been modified"
[ -z "$missing_files" ] && exit 0 || exit 1
test:
runs-on: ubuntu-latest
steps:
Expand All @@ -43,7 +22,6 @@ jobs:
runs-on: ubuntu-latest
needs:
- test
- ensure-mandatory-files
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -56,7 +34,7 @@ jobs:
- name: Prepare files
run: |
mkdir npm_public
mv release package.json package-lock.json npm_public
mv release package.json package-lock.json LICENSE npm_public
cd npm_public
echo //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} > .npmrc
- name: Publish
Expand Down

0 comments on commit 7810c38

Please sign in to comment.