Skip to content

Commit

Permalink
Merge pull request #4944 from MohamedSabthar/workflow-mig
Browse files Browse the repository at this point in the history
Add step to dynamically set env variables in template workflows
  • Loading branch information
MohamedSabthar authored Oct 17, 2023
2 parents 7db0998 + b95de56 commit c0824a0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build-timestamp-master-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Set ENV Variables
run: |
echo -e '${{ toJson(secrets) }}' | jq -r 'to_entries[] | .key + "=" + .value' >> $GITHUB_ENV
- name: Build with Gradle
env:
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/central-publish-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:
with:
distribution: "temurin"
java-version: 17.0.7

- name: Set ENV Variables
run: |
echo -e '${{ toJson(secrets) }}' | jq -r 'to_entries[] | .key + "=" + .value' >> $GITHUB_ENV
- name: Build with Gradle
env:
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/pull-request-build-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ jobs:
distribution: 'temurin'
java-version: 17.0.7

- name: Set ENV Variables
run: |
echo -e '${{ toJson(secrets) }}' | jq -r 'to_entries[] | .key + "=" + .value' >> $GITHUB_ENV
- name: Build the Package
env:
packageUser: ${{ github.actor }}
Expand Down Expand Up @@ -69,6 +73,10 @@ jobs:
distribution: 'temurin'
java-version: 17.0.7

- name: Set ENV Variables
run: |
echo '${{ toJson(secrets) }}' | jq -r 'to_entries[] | .key + \"=\" + .value' | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Build the Project
env:
packageUser: ${{ github.actor }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release-package-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ jobs:
with:
distribution: 'temurin'
java-version: 17.0.7

- name: Set ENV Variables
run: |
echo -e '${{ toJson(secrets) }}' | jq -r 'to_entries[] | .key + "=" + .value' >> $GITHUB_ENV
- name: Build without Tests
env:
Expand Down

0 comments on commit c0824a0

Please sign in to comment.