Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FSMCPB-152082] Migrate to GHA 2 #167

Merged
merged 2 commits into from
Oct 31, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[FSMCPB-152082] Migrate to GHA 2
  • Loading branch information
zaheral committed Oct 30, 2024
commit 6f8f74bde0b79a334118df7b7e567edf7e36735d
22 changes: 22 additions & 0 deletions .github/workflows/fsh-shell_pull-request.yml
Original file line number Diff line number Diff line change
@@ -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:
23 changes: 1 addition & 22 deletions .github/workflows/fsh-shell_push.yml
Original file line number Diff line number Diff line change
@@ -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:
@@ -56,7 +35,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