A GitHub Action to add AMP Theme Compatability Analysis on pull requests as a comment to depict the comptaibility change percentages by that PR vs base branch. It is based on amp-wp-theme-compat-analysis.
The action does this following:
- Analysis is done on pull request for the theme(s) that are involved in it.
- Analysis is done against the changes in pull request as well as the base branch of the pull request.
- It is posted as a comment and only for the theme being updated in the pull request.
- If the Pull request is updated, i.e., new commits are added, then analysis will be re-computed and the comment will be updated with the latest commit's data.
This action requires the repository in a certain way, it needs to have all the themes in parent directory of the repository, like this repository.
- Create a
.github/workflows/amp-analysis.ymlin your GitHub repo, if one doesn't exist already. - Add the following code to the
amp-analysis.ymlfile.
on: pull_request
name: Run amp-theme-compat-analysis
jobs:
Run-amp-theme-compat-analysis:
name: Run amp-theme-compat-analysis
runs-on: ubuntu-18.04
steps:
- name: Checkout PR
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
path: main
- name: Checkout Base Branch
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.base.sha }}
path: base
- name: Run amp-theme-compat-analysis
uses: rtCamp/action-amp-wp-theme-compat-analysis@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}AMP WP Theme Compatability Analysis in action
MIT © 2019 rtCamp

