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
Show file tree
Hide file tree
Changes from all commits
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
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 @@
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:]')

Check warning on line 19 in .github/workflows/fsh-shell_pull-request.yml

View check run for this annotation

In Solidarity / Inclusive Language

Match Found

Please consider an alternative to `master`. Possibilities include: `primary`, `main`, `leader`, `active`, `writer`
Raw output
/\b(?!masterdata|masterdata\w+\b)master/gi
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
Loading