Skip to content

Commit

Permalink
add job to update latest-dev-version file (#10365)
Browse files Browse the repository at this point in the history
* add job to update latest-dev-version file

Add a workflow that updates the latest-dev-version file and publishes
it.

* Update .github/workflows/pulumi-cli-dev-version.yml

Co-authored-by: Christian Nunciato <[email protected]>

* Update .github/workflows/pulumi-cli-dev-version.yml

Co-authored-by: Christian Nunciato <[email protected]>

* Update .github/workflows/pulumi-cli-dev-version.yml

Co-authored-by: Christian Nunciato <[email protected]>

* Update .github/workflows/pulumi-cli-dev-version.yml

Co-authored-by: Christian Nunciato <[email protected]>

---------

Co-authored-by: Christian Nunciato <[email protected]>
  • Loading branch information
tgummerer and cnunciato authored Dec 15, 2023
1 parent 7ef040a commit d6e6ad2
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/pulumi-cli-dev-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
env:
GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }}

name: Update latest-dev-version
on:
repository_dispatch:
types:
- pulumi-cli-dev-version
jobs:
pull-request:
runs-on: ubuntu-latest
needs: update-latest-dev-version
steps:
- name: checkout docs repo
uses: actions/checkout@v2
- name: pull-request
uses: repo-sync/pull-request@v2
with:
source_branch: "pulumi/${{ github.run_id }}-${{ github.run_number }}"
destination_branch: "master"
pr_title: "Regen dev version pulumi@${{ github.event.client_payload.dev_version}}"
pr_body: "Automated PR"
github_token: ${{ secrets.PULUMI_BOT_TOKEN }}
update-latest-dev-version:
runs-on: ubuntu-latest
steps:
- name: checkout docs repo
uses: actions/checkout@v2
- name: Update latest version
run: |
echo -n "${{ github.event.client_payload.dev_version }}" > ./static/latest-dev-version
- name: git status
run: git status && git diff
- name: commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "pulumi-bot"
git checkout -b pulumi/${{ github.run_id }}-${{ github.run_number }}
git add static/latest-dev-version
git commit -m "Updating latest pulumi dev version@${{ github.event.client_payload.dev_version }}"
git push origin pulumi/${{ github.run_id }}-${{ github.run_number }}
notify:
if: failure()
name: Send slack notification
runs-on: ubuntu-latest
needs: [pull-request, update-latest-dev-version]
steps:
- name: Slack Notification
uses: docker://sholung/action-slack-notify:v2.3.0
env:
SLACK_CHANNEL: docs-ops
SLACK_COLOR: "#F54242"
SLACK_MESSAGE: "cli docs build failure in pulumi/docs repo :meow_sad:"
SLACK_USERNAME: docsbot
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_ICON: https://www.pulumi.com/logos/brand/avatar-on-white.png

0 comments on commit d6e6ad2

Please sign in to comment.