diff --git a/.github/workflows/close-stale-issues.yml b/.github/workflows/close-stale-issues.yml new file mode 100644 index 0000000..b41cdd6 --- /dev/null +++ b/.github/workflows/close-stale-issues.yml @@ -0,0 +1,36 @@ +# **What it does**: Closes issues where the original author doesn't respond to a request for information. +# **Why we have it**: To remove the need for maintainers to remember to check back on issues periodically to see if contributors have responded. + +name: Close stale issues + +on: + schedule: + # Schedule for every day at 1:30am UTC + - cron: '30 1 * * *' + +permissions: + issues: write + +jobs: + stale: + runs-on: ubuntu-latest + + steps: + - uses: actions/stale@v9 + with: + days-before-stale: 7 + days-before-close: 7 + stale-issue-message: > + It has been 7 days since more information was requested from you in this issue and we have not heard back. This issue is now marked as stale and will be closed in 7 days, but if you have more information to add then please comment and the issue will stay open. + close-issue-message: > + This issue has been automatically closed because there has been no response + to our request for more information. With only the + information that is currently in the issue, we don't have enough information + to take action. Please reach out if you have or find the answers we need so + that we can investigate further. See [this blog post on bug reports and the + importance of repro steps](https://www.lee-dohm.com/2015/01/04/writing-good-bug-reports/) + for more information about the kind of information that may be helpful. + stale-issue-label: 'stale' + close-issue-reason: 'not_planned' + any-of-labels: 'reporter feedback' + remove-stale-when-updated: true diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..575869d --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,48 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. + +name: CodeQL + +on: + push: + branches: + - develop + - main + pull_request: + branches: + - develop + schedule: + - cron: '24 4 * * 5' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'javascript' ] + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml new file mode 100644 index 0000000..bd8ad03 --- /dev/null +++ b/.github/workflows/dependency-review.yml @@ -0,0 +1,31 @@ +# Dependency Review Action +# +# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging. +# +# Source repository: https://github.com/actions/dependency-review-action +# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement + +name: Dependency Review + +on: + pull_request: + branches: + - develop + +permissions: + contents: read + +jobs: + dependency-review: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Dependency Review + uses: actions/dependency-review-action@v4 + with: + license-check: true + vulnerability-check: false + config-file: 10up/.github/.github/dependency-review-config.yml@trunk diff --git a/.github/workflows/repo-automator.yml b/.github/workflows/repo-automator.yml new file mode 100644 index 0000000..54a980f --- /dev/null +++ b/.github/workflows/repo-automator.yml @@ -0,0 +1,34 @@ +name: 'Repo Automator' + +on: + issues: + types: + - opened + push: + branches: + - develop + pull_request: + types: + - opened + - edited + - synchronize + - converted_to_draft + - ready_for_review + branches: + - develop + +jobs: + Validate: + runs-on: ubuntu-latest + + steps: + - uses: 10up/action-repo-automator@trunk + with: + fail-label: needs:feedback + pass-label: needs:code-review + conflict-label: needs:refresh + reviewers: | + dkotter + team:open-source-practice + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/wordpress-plugin-asset-update.yml b/.github/workflows/wordpress-plugin-asset-update.yml new file mode 100644 index 0000000..8f8f3d7 --- /dev/null +++ b/.github/workflows/wordpress-plugin-asset-update.yml @@ -0,0 +1,28 @@ +name: Plugin asset/readme update + +on: + push: + branches: + - main + +jobs: + main: + name: Push to main + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup node version + uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + cache: npm + + - name: WordPress.org plugin asset/readme update + uses: 10up/action-wordpress-plugin-asset-update@stable + env: + SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} + SVN_USERNAME: ${{ secrets.SVN_USERNAME }} + SLUG: mailchimp diff --git a/.github/workflows/wordpress-plugin-deploy.yml b/.github/workflows/wordpress-plugin-deploy.yml new file mode 100644 index 0000000..defa34b --- /dev/null +++ b/.github/workflows/wordpress-plugin-deploy.yml @@ -0,0 +1,34 @@ +name: Deploy to WordPress.org + +on: + release: + types: [published] + +jobs: + tag: + name: New release + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: WordPress Plugin Deploy + id: deploy + uses: 10up/action-wordpress-plugin-deploy@stable + with: + generate-zip: true + env: + SVN_USERNAME: ${{ secrets.SVN_USERNAME }} + SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} + SLUG: mailchimp + + - name: Upload release asset + uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ${{ steps.deploy.outputs.zip-path }} + asset_name: mailchimp.zip + asset_content_type: application/zip