From 4dab83c5becd790c2d161dc9c9a00bcdbb05d16a Mon Sep 17 00:00:00 2001 From: SydneyDF Date: Wed, 1 Feb 2023 10:43:55 +0800 Subject: [PATCH] fix: fix branch missing redirects to outputs + yaml lint (#10) --- action.yml | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/action.yml b/action.yml index cf73d5c..080a0f2 100644 --- a/action.yml +++ b/action.yml @@ -1,51 +1,51 @@ -name: 'PMD Analyser' -description: 'Runs PMD Source Code Analyser based on the ruleset defined - https://pmd.github.io/' +name: "PMD Analyser" +description: "Runs PMD Source Code Analyser based on the ruleset defined - https://pmd.github.io/" branding: - icon: 'zoom-in' - color: 'yellow' + icon: "zoom-in" + color: "yellow" inputs: analyse-all-code: - description: 'Used to determine whether you just want to analyse the files changed or the whole repository.' + description: "Used to determine whether you just want to analyse the files changed or the whole repository." required: false - default: 'false' + default: "false" auth-token: - description: 'If you are looking to compare the file difference based on the GitHub pull request, you will need to specify the [GitHub secrets token](https://docs.github.com/en/actions/reference/authentication-in-a-workflow)' + description: "If you are looking to compare the file difference based on the GitHub pull request, you will need to specify the [GitHub secrets token](https://docs.github.com/en/actions/reference/authentication-in-a-workflow)" required: false error-rules: - description: 'If you wish to define rules that log as an error, enter each rule name separated with a comma and no spaces. Note that if an error is identified the run will fail. e.g. ClassNamingConventions,GuardLogStatement' + description: "If you wish to define rules that log as an error, enter each rule name separated with a comma and no spaces. Note that if an error is identified the run will fail. e.g. ClassNamingConventions,GuardLogStatement" required: false file-diff-type: - description: 'Choose whether you want the file comparison to be based on a git diff or based on the files changed specified on the GitHub pull request. Note that if you use the GitHub pull request option, this action will only work on a pull request event. Options to set this are either `git` or `github`.' + description: "Choose whether you want the file comparison to be based on a git diff or based on the files changed specified on the GitHub pull request. Note that if you use the GitHub pull request option, this action will only work on a pull request event. Options to set this are either `git` or `github`." required: false - default: 'git' + default: "git" file-path: - description: 'Path to the sources to analyse. This can be a file name, a directory, or a jar or zip file containing the sources.' + description: "Path to the sources to analyse. This can be a file name, a directory, or a jar or zip file containing the sources." required: true note-rules: - description: 'If you wish to define rules that log as a note, enter each rule name separated with a comma and no spaces. Note that if a note is identified the run will not fail. e.g. ClassNamingConventions,GuardLogStatement' + description: "If you wish to define rules that log as a note, enter each rule name separated with a comma and no spaces. Note that if a note is identified the run will not fail. e.g. ClassNamingConventions,GuardLogStatement" required: false pmd-version: - description: 'The version of PMD you would like to run. You can either specify latest to always get the newest version, or you can specify a version number like 6.37.0' + description: "The version of PMD you would like to run. You can either specify latest to always get the newest version, or you can specify a version number like 6.37.0" required: false - default: 'latest' + default: "latest" rules-path: - description: 'The ruleset file you want to use. PMD uses xml configuration files, called rulesets, which specify which rules to execute on your sources. You can also run a single rule by referencing it using its category and name (more details here). For example, you can check for unnecessary modifiers on Java sources with -R category/java/codestyle.xml/UnnecessaryModifier.' + description: "The ruleset file you want to use. PMD uses xml configuration files, called rulesets, which specify which rules to execute on your sources. You can also run a single rule by referencing it using its category and name (more details here). For example, you can check for unnecessary modifiers on Java sources with -R category/java/codestyle.xml/UnnecessaryModifier." required: true outputs: error-found: - description: 'Identifies whether an error has been found based on the ruleset.' + description: "Identifies whether an error has been found based on the ruleset." value: ${{ steps.pmd-analysis.outputs.error-found }} runs: using: "composite" - steps: + steps: - id: code run: | if [ ${{ github.event_name }} == 'pull_request' ]; then echo "current_code=${{ github.base_ref }}" >> $GITHUB_OUTPUT - echo "changed_code=${{ github.head_ref }}" $GITHUB_OUTPUT + echo "changed_code=${{ github.head_ref }}" >> $GITHUB_OUTPUT else - echo "current_code=${{ github.event.before }}" $GITHUB_OUTPUT - echo "changed_code=${{ github.event.after }}" $GITHUB_OUTPUT + echo "current_code=${{ github.event.before }}" >> $GITHUB_OUTPUT + echo "changed_code=${{ github.event.after }}" >> $GITHUB_OUTPUT fi shell: bash - id: pmd-analysis @@ -65,4 +65,4 @@ runs: AUTH_TOKEN: ${{ inputs.auth-token }} FILE_DIFF_TYPE: ${{ inputs.file-diff-type }} WORKSPACE: ${{ github.workspace }}/ - ACTION_EVENT_NAME: ${{ github.event_name }} \ No newline at end of file + ACTION_EVENT_NAME: ${{ github.event_name }}