Skip to content

Commit

Permalink
add workflow permission
Browse files Browse the repository at this point in the history
  • Loading branch information
amit-kremer93 committed Jan 8, 2025
1 parent 2d30f01 commit 3d57498
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/deploy-to-QA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: Deploy To QA
on:
workflow_call:

permissions:
contents: write

jobs:
Deploy-to-QA:
runs-on: ubuntu-latest
Expand All @@ -16,7 +19,7 @@ jobs:
run: |
git config --global user.name $COMMIT_AUTHOR
git config --global user.email $COMMIT_EMAIL
- name: Check if fixed version is on Jira
env:
JIRA_TOKEN: ${{ secrets.CI_JIRA_TOKEN }}
Expand All @@ -27,8 +30,8 @@ jobs:
jira_fixed_version="React Native SDK v$plugin_version"
echo "JIRA_FIXED_VERSION=$jira_fixed_version" >> $GITHUB_ENV
chmod +x .github/workflows/scripts/releaseNotesGenerator.sh
.github/workflows/scripts/releaseNotesGenerator.sh $JIRA_TOKEN "$jira_fixed_version"
.github/workflows/scripts/releaseNotesGenerator.sh $JIRA_TOKEN "$jira_fixed_version"
- name: Check version alignment between platforms
env:
BRANCH_NAME: ${{github.ref_name}}
Expand All @@ -54,7 +57,7 @@ jobs:
- name: Generate and send slack report
env:
SLACK_TOKEN: ${{ secrets.CI_SLACK_TOKEN }}
run: |
run: |
ios_sdk_version=$(cat react-native-appsflyer.podspec | grep '\'AppsFlyerFramework\' | grep -Eo '[0-9].[0-9]+.[0-9]+')
android_sdk_version=$(cat android/build.gradle | grep 'com.appsflyer:af-android-sdk' | grep -Eo '[0-9].[0-9]+.[0-9]+')
CHANGES=$(cat "${{env.JIRA_FIXED_VERSION}}-releasenotes".txt)
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/pre-release-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ on:
types:
- opened
branches:
- 'master'
- "master"

permissions:
contents: write

jobs:
Prepare-Plugin-For-Production:
Expand Down Expand Up @@ -34,7 +37,7 @@ jobs:
echo "Updating plugin to version $plugin_version"
npm version $plugin_version
git push origin HEAD:${{ steps.vars.outputs.branch }} --force
- name: Update CHANGELOG.md
env:
JIRA_TOKEN: ${{ secrets.CI_JIRA_TOKEN }}
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/release-Production-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ on:
types:
- closed
branches:
- 'master'
- "master"
paths-ignore:
- '**.md'
- '**.yml'
- 'demoes/**'
- 'Docs/**'
- "**.md"
- "**.yml"
- "demoes/**"
- "Docs/**"

permissions:
contents: write

jobs:
Deploy-To-Production:
if: github.event.pull_request.merged == true
Expand All @@ -35,7 +39,7 @@ jobs:
echo "PLUGIN_VERSION=$TAG" >> $GITHUB_ENV
echo "RELEASE_BRANCH_NAME=${{ steps.vars.outputs.branch }}" >> $GITHUB_ENV
echo "push new release >> $TAG"
- name: "Create release"
env:
TAG: ${{env.PLUGIN_VERSION}}
Expand Down Expand Up @@ -64,7 +68,6 @@ jobs:
echo "//registry.npmjs.org/:_authToken=$CI_NPM_TOKEN" > ~/.npmrc
npm publish
- name: Generate and send slack report
env:
SLACK_TOKEN: ${{ secrets.CI_SLACK_TOKEN }}
Expand Down

0 comments on commit 3d57498

Please sign in to comment.