Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add standard GitHub Action Workflows that are missing #21

Merged
merged 6 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/close-stale-issues.yml
Original file line number Diff line number Diff line change
@@ -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
48 changes: 48 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -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
31 changes: 31 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -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
34 changes: 34 additions & 0 deletions .github/workflows/repo-automator.yml
Original file line number Diff line number Diff line change
@@ -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 }}
28 changes: 28 additions & 0 deletions .github/workflows/wordpress-plugin-asset-update.yml
Original file line number Diff line number Diff line change
@@ -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
34 changes: 34 additions & 0 deletions .github/workflows/wordpress-plugin-deploy.yml
Original file line number Diff line number Diff line change
@@ -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 }}
Comment on lines +22 to +23
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noting that this won't run fully to deploy to WP.org until these credentials are added as repo secrets

SLUG: mailchimp

- name: Upload release asset
uses: actions/[email protected]
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
Loading