diff --git a/.github/workflows/acceptance-test.yml b/.github/workflows/acceptance-test.yml deleted file mode 100644 index 05746ba078d..00000000000 --- a/.github/workflows/acceptance-test.yml +++ /dev/null @@ -1,95 +0,0 @@ -# -# This GitHub action runs Packer's acceptance tests every night. -# Failures are reported to slack. -# - -name: "Acceptance Test" - -on: - schedule: - # Runs against the default branch every day at midnight - - cron: "0 0 * * *" - -permissions: - contents: read - -jobs: - get-go-version: - runs-on: ubuntu-latest - outputs: - go-version: ${{ steps.get-go-version.outputs.go-version }} - steps: - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - - name: 'Determine Go version' - id: get-go-version - # We use .go-version as our source of truth for current Go - # version, because "goenv" can react to it automatically. - run: | - echo "Building with Go $(cat .go-version)" - echo "go-version=$(cat .go-version)" >> $GITHUB_OUTPUT - acceptance-test: - runs-on: ubuntu-latest - name: Acceptance Test - needs: get-go-version - env: - # AWS Creds for Assume Role - AWS_ROLE_ARN: ${{ secrets.AWS_ROLE_ARN }} - AWS_ACCESS_KEY_ID: ${{ secrets.TESTACC_AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.TESTACC_AWS_SECRET_ACCESS_KEY }} - AWS_REGION: ${{ secrets.TESTACC_AWS_REGION }} - # Packer GH Token for API Rate Limiting - PACKER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - - uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 - with: - go-version: ${{ needs.get-go-version.outputs.go-version }} - - name: IAM Assume Role - uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 - with: - role-to-assume: ${{ env.AWS_ROLE_ARN }} - aws-region: ${{ env.AWS_REGION }} - aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ env.AWS_SECRET_ACCESS_KEY }} - role-duration-seconds: 3600 - - name: Install gotestsum - run: go install gotest.tools/gotestsum@latest - - name: Run acceptance tests per module - run: | - mkdir -p /tmp/test-results - make dev - PACKER_ACC=1 gotestsum --format=short-verbose --junitfile /tmp/test-results/gotestsum-report.xml -- -timeout=120m -p 2 $(go list ./... | grep -v inspec | grep -v profitbricks | grep -v oneandone) - # Send a slack notification if either job defined above fails - slack-notify: - permissions: - contents: none - needs: - - get-go-version - - acceptance-test - if: always() && (needs.get-go-version.result == 'failure' || needs.acceptance-test.result == 'failure') - runs-on: ubuntu-latest - steps: - - name: Send slack notification on failure - uses: slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e # v1.26.0 - with: - payload: | - { - "text": ":alert: Packer Nightly Acceptance Tests *FAILED* :alert:", - "attachments": [ - { - "color": "#C41E3A", - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "Branch: `${{ github.ref_name }}`\nRef: ${{ github.event.pull_request.html_url || github.event.head_commit.url }}\nWorkflow: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" - } - } - ] - } - ] - } - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK diff --git a/.github/workflows/auto-close-stale-issues.yml b/.github/workflows/auto-close-stale-issues.yml deleted file mode 100644 index 2e593d579fa..00000000000 --- a/.github/workflows/auto-close-stale-issues.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Close Stale Issues - -on: - schedule: - - cron: '0 0 * * *' - -permissions: - contents: read - -jobs: - stale-bot: - permissions: - issues: write # for actions/stale to close stale issues - pull-requests: write # for actions/stale to close stale PRs - runs-on: ubuntu-latest - steps: - - uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9.0.0 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - days-before-issue-stale: 23 - days-before-pr-stale: -1 # deactivate the action for PRs - days-before-close: 7 - stale-issue-message: | - Hi, - - This issue has not received any update in the last 3 weeks, and will automatically be closed in 7 days if it does not receive any activity by then. - - If you find the [community forum](https://discuss.hashicorp.com/c/packer) to be more helpful or if you've found the answer to your question elsewhere please feel free to post a response and close the issue. - only-labels: needs-reply diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml deleted file mode 100644 index 7cbfe6c6c30..00000000000 --- a/.github/workflows/lock.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: 'Lock Threads' - -on: - schedule: - - cron: '50 1 * * *' - -# Only 50 issues will be handled during a given run. -permissions: - contents: read - -jobs: - lock: - permissions: - issues: write # for dessant/lock-threads to lock issues - pull-requests: write # for dessant/lock-threads to lock PRs - runs-on: ubuntu-latest - steps: - - uses: dessant/lock-threads@1bf7ec25051fe7c00bdd17e6a7cf3d7bfb7dc771 # v5.0.1 - with: - github-token: ${{ github.token }} - issue-comment: > - I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues. - - If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. - issue-inactive-days: '30' - # Issues older than 180 days ago should be ignored - exclude-issue-created-before: '2020-11-01' - pr-comment: > - I'm going to lock this pull request because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues. - - If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. - pr-inactive-days: '30' - # Issues older than 180 days ago should be ignored - exclude-pr-created-before: '2020-11-01' - diff --git a/.github/workflows/nightly-release.yml b/.github/workflows/nightly-release.yml deleted file mode 100644 index bffc6da67e5..00000000000 --- a/.github/workflows/nightly-release.yml +++ /dev/null @@ -1,142 +0,0 @@ -# -# This GitHub action triggers a fresh set of Packer builds -# and publishes them to GitHub Releases under the `nightly` tag. -# Note that artifacts available via GitHub Releases are not codesigned or notarized. -# Failures are reported to slack. -# - -name: Nightly Release - -on: - schedule: - # Runs against the default branch every day at midnight - - cron: "0 0 * * *" - workflow_dispatch: - -permissions: - contents: write - -jobs: - # Build a fresh set of artifacts - build-artifacts: - uses: hashicorp/packer/.github/workflows/build.yml@main - github-release: - needs: build-artifacts - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - - name: Download built artifacts - uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 - with: - path: out/ - # Set BUILD_OUTPUT_LIST to out\-.\*,out\... - # This is needed to attach the build artifacts to the GitHub Release - - name: Set BUILD_OUTPUT_LIST - run: | - echo "$(ls -xm1 out/)" > tmp.txt - cat tmp.txt | sed 's:.*:out/&/*:' > tmp2.txt - echo "BUILD_OUTPUT_LIST=$(cat tmp2.txt | tr '\n' ',' | perl -ple 'chop')" >> $GITHUB_ENV - rm -rf tmp.txt && rm -rf tmp2.txt - - name: Advance nightly tag - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - try { - await github.rest.git.deleteRef({ - owner: context.repo.owner, - repo: context.repo.repo, - ref: "tags/nightly" - }) - } catch (e) { - console.log("Warning: The nightly tag doesn't exist yet, so there's nothing to do. Trace: " + e) - } - await github.rest.git.createRef({ - owner: context.repo.owner, - repo: context.repo.repo, - ref: "refs/tags/nightly", - sha: context.sha - }) - # This will create a new GitHub Release called `nightly` - # If a release with this name already exists, it will overwrite the existing data - - name: Create a nightly GitHub prerelease - id: create_prerelease - continue-on-error: true - uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0 - with: - name: nightly - artifacts: "${{ env.BUILD_OUTPUT_LIST }}" - tag: nightly - bodyFile: ".github/workflows/nightly-release-readme.md" - prerelease: true - allowUpdates: true - removeArtifacts: true - draft: false - token: ${{ secrets.GITHUB_TOKEN }} - - name: Store GitHub Release ID - if: steps.create_prerelease.outcome == 'success' - run: | - echo "prerelease_id=${{ steps.create_prerelease.outputs.id }}" >> $GITHUB_ENV - - name: Sleep before retry - id: sleep_before_retry - if: steps.create_prerelease.outcome == 'failure' - run : sleep 30m - shell: bash - - name: Retry failed nightly GitHub prerelease - id: create_prerelease_retry - if: steps.create_prerelease.outcome == 'failure' - uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0 - with: - name: nightly - artifacts: "${{ env.BUILD_OUTPUT_LIST }}" - tag: nightly - bodyFile: ".github/workflows/nightly-release-readme.md" - prerelease: true - allowUpdates: true - removeArtifacts: true - draft: false - token: ${{ secrets.GITHUB_TOKEN }} - - name: Store Updated GitHub Release ID - if: steps.create_prerelease_retry.outcome == 'success' - run: | - echo "prerelease_id=${{ steps.create_prerelease_retry.outputs.id }}" >> $GITHUB_ENV - - name: Publish nightly GitHub prerelease - uses: eregon/publish-release@01df127f5e9a3c26935118e22e738d95b59d10ce # v1.0.6 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - release_id: ${{ env.prerelease_id }} - # Send a slack notification if either job defined above fails - slack-notify: - permissions: - contents: none - needs: - - build-artifacts - - github-release - if: always() && (needs.build-artifacts.result == 'failure' || needs.github-release.result == 'failure') - runs-on: ubuntu-latest - steps: - - name: Send slack notification on failure - uses: slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e # v1.26.0 - with: - payload: | - { - "text": ":alert: Packer Nightly Release *FAILED* :alert:", - "attachments": [ - { - "color": "#C41E3A", - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "Branch: `${{ github.ref_name }}`\nRef: ${{ github.sha }}\nWorkflow: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" - } - } - ] - } - ] - } - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK