XWIKI-24241: The image quick action should provide image suggestions and allow browsing existing images #298
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## --------------------------------------------------------------------------- | |
| ## See the NOTICE file distributed with this work for additional | |
| ## information regarding copyright ownership. | |
| ## | |
| ## This is free software; you can redistribute it and/or modify it | |
| ## under the terms of the GNU Lesser General Public License as | |
| ## published by the Free Software Foundation; either version 2.1 of | |
| ## the License, or (at your option) any later version. | |
| ## | |
| ## This software is distributed in the hope that it will be useful, | |
| ## but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| ## Lesser General Public License for more details. | |
| ## | |
| ## You should have received a copy of the GNU Lesser General Public | |
| ## License along with this software; if not, write to the Free | |
| ## Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
| ## 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |
| ## --------------------------------------------------------------------------- | |
| ## Hold each pull request to the quality rules the code base is held to, and fail it when the change | |
| ## breaks one, so that it is caught before the merge instead of turning the master quality build red | |
| ## afterwards. Everything but the trigger lives in the shared workflow, which every XWiki repository | |
| ## calls, so that a change to what is checked is made once. See https://github.com/xwiki/.github | |
| ## | |
| ## This is the half of the trigger that "pull_request" can serve on its own. Its companion, | |
| ## quality-pr-sonar.yml, takes the pull requests this one cannot check in full: those from a fork, | |
| ## which a pull_request run is handed no repository secrets for, and so no SonarQube token. | |
| name: Pull request quality checks | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| ## One run per pull request: a new commit makes the running one obsolete. | |
| concurrency: | |
| group: quality-pr-${{ github.event.pull_request.number }} | |
| cancel-in-progress: true | |
| jobs: | |
| analysis: | |
| ## A reusable workflow names its check "<this job> / <the called job>", so this reads | |
| ## "Quality / Analyze". quality-pr-sonar.yml names its own job identically on purpose: exactly | |
| ## one of the two ever runs for a given pull request, so the check to require is called the same | |
| ## whichever one it was. | |
| name: Quality | |
| ## The pull requests this workflow answers for, which are the ones quality-pr-sonar.yml leaves to | |
| ## it: a branch pushed into this repository, which a pull_request run does hand SONAR_TOKEN to, | |
| ## and a fork whose author GitHub does not report as one of ours, which gets the Checkstyle | |
| ## verdict alone. This condition is the exact negation of that workflow's, so that a pull request | |
| ## is built once and not twice; changing one of the two means changing the other. | |
| if: >- | |
| github.event.pull_request.head.repo.full_name == github.repository | |
| || !contains(fromJSON('["OWNER", "MEMBER"]'), | |
| github.event.pull_request.author_association) | |
| ## For a reusable workflow the GITHUB_TOKEN permissions are the caller's. The analysis only | |
| ## reads the sources. | |
| permissions: | |
| contents: read | |
| ## Referenced by branch and not by commit hash, on purpose: pinning would mean a pull request in | |
| ## every repository for every change to the shared workflow, which is the duplication this | |
| ## indirection removes. What pinning protects against, a third party repointing the ref under | |
| ## us, does not apply to a repository the XWiki committers own themselves. | |
| uses: xwiki/.github/.github/workflows/quality-pr.yml@master | |
| with: | |
| ## A pull_request run from a fork is given no repository secrets, so there is no token to | |
| ## analyze with and Checkstyle is the whole verdict. SonarCloud sees such a change after the | |
| ## merge, in the master analysis, as it did before this workflow existed. | |
| sonar: ${{ github.event.pull_request.head.repo.full_name == github.repository }} | |
| secrets: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |