From d6e6ad24e967211b0db4858cf5b46757bedb5fcf Mon Sep 17 00:00:00 2001 From: Thomas Gummerer Date: Fri, 15 Dec 2023 08:26:52 +0100 Subject: [PATCH] add job to update latest-dev-version file (#10365) * 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 * Update .github/workflows/pulumi-cli-dev-version.yml Co-authored-by: Christian Nunciato * Update .github/workflows/pulumi-cli-dev-version.yml Co-authored-by: Christian Nunciato * Update .github/workflows/pulumi-cli-dev-version.yml Co-authored-by: Christian Nunciato --------- Co-authored-by: Christian Nunciato --- .github/workflows/pulumi-cli-dev-version.yml | 56 ++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/pulumi-cli-dev-version.yml diff --git a/.github/workflows/pulumi-cli-dev-version.yml b/.github/workflows/pulumi-cli-dev-version.yml new file mode 100644 index 000000000000..9b0258880186 --- /dev/null +++ b/.github/workflows/pulumi-cli-dev-version.yml @@ -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 "bot@pulumi.com" + 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