Skip to content

Commit

Permalink
revert to using GITHUB_ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
kMutagene committed Mar 19, 2024
1 parent c7a7666 commit c3b2c6e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ jobs:
needs: test-staging-area
runs-on: ubuntu-latest
outputs:
trigger-update-preview-index: ${{ steps.ppc.outputs.trigger-release-staging-area }}
trigger-publish-pending-packages: ${{ steps.ppc.outputs.trigger-publish-pending-packages }}
trigger-update-preview-index: ${{ steps.set-output.outputs.trigger-update-preview-index }}
trigger-publish-pending-packages: ${{ steps.set-output.outputs.trigger-publish-pending-packages }}
steps:
- uses: actions/checkout@v4
- name: Set up .NET
Expand All @@ -229,11 +229,18 @@ jobs:
id: ppc
run: |
dotnet fsi scripts/pre-publish-checks.fsx
- name: set-output
id: set-output
run: |
echo "trigger-update-preview-index=$UPDATE_PREVIEW_INDEX"
echo "trigger-update-preview-index=$UPDATE_PREVIEW_INDEX" >> $GITHUB_OUTPUT
echo "trigger-publish-pending-packages=$PUBLISH_PENDING_PACKAGES"
echo "trigger-publish-pending-packages=$PUBLISH_PENDING_PACKAGES" >> $GITHUB_OUTPUT
- name: list triggered jobs
run: |
echo "this should trigger the following jobs:"
echo "trigger-update-preview-index: ${{steps.ppc.outputs.trigger-update-preview-index}}"
echo "trigger-publish-pending-packages: ${{steps.ppc.outputs.trigger-publish-pending-packages}}"
echo "trigger-update-preview-index: ${{steps.set-output.outputs.trigger-update-preview-index}}"
echo "trigger-publish-pending-packages: ${{steps.set-output.outputs.trigger-publish-pending-packages}}"
update-preview-index:
needs: staging-area-pre-publish-checks
Expand Down
2 changes: 1 addition & 1 deletion StagingArea/test/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Tags:
- Name: validation
- Name: my-package
- Name: thing
ReleaseNotes: "Trigger another CI run!"
ReleaseNotes: "Trigger another CI run"
---
*)

Expand Down
4 changes: 2 additions & 2 deletions scripts/pre-publish-checks.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ open System
open System.IO

// https://stackoverflow.com/questions/70123328/how-to-set-environment-variables-in-github-actions-using-python
let GITHUB_ENV = Environment.GetEnvironmentVariable("GITHUB_OUTPUT")
let GITHUB_ENV = Environment.GetEnvironmentVariable("GITHUB_ENV")

if staging_diff.Length > 0 then
File.AppendAllLines(GITHUB_ENV, ["UPDATE_PREVIEW_INDEX=true"])
else
File.AppendAllLines(GITHUB_ENV, ["UPDATE_PREVIEW_INDEX=false"])

printfn $"""GITHUB_OUTPUT={File.ReadAllText(GITHUB_ENV)}"""
printfn $"""GITHUB_ENV={File.ReadAllText(GITHUB_ENV)}"""

0 comments on commit c3b2c6e

Please sign in to comment.