diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index bdf42306..f7dad81d 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -23,21 +23,31 @@ jobs: echo "SHA=$(git rev-parse "$GITHUB_SHA")" >> $GITHUB_OUTPUT id: git - - name: Switch to main branch + - name: Get RC branch name + run: | + git fetch --all + EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) + echo "RC_BRANCH<<$EOF" >> $GITHUB_OUTPUT + echo "$(git branch -r --list 'origin/RC*' --sort=-committerdate | head -n 1 | sed 's/origin\///' | xargs)" >> $GITHUB_OUTPUT + echo "$EOF" >> $GITHUB_OUTPUT + id: branch_name + + - name: Checkout RC branch uses: actions/checkout@v3 with: - ref: main + ref: ${{ steps.branch_name.outputs.RC_BRANCH }} - name: Install tobac and pylint run: | pip install . pip install --upgrade pylint - - name: Get pylint score of main branch + + - name: Get pylint score of RC branch run: | pylint tobac --disable=C --exit-zero id: main_score - - name: Switch to PR branch + - name: Checkout PR branch uses: actions/checkout@v3 with: ref: "${{ steps.git.outputs.SHA}}" @@ -62,7 +72,7 @@ jobs: Linting results by Pylint: -------------------------- ${{ steps.pr_score.outputs.MESSAGE}} - The linting score is an indicator that reflects how well your code version follows Pylint’s coding standards and quality metrics with respect to the main branch. + The linting score is an indicator that reflects how well your code version follows Pylint’s coding standards and quality metrics with respect to the ${{ steps.branch_name.outputs.RC_BRANCH}} branch. A decrease usually indicates your new code does not fully meet style guidelines or has potential errors. repo-token: ${{ secrets.GITHUB_TOKEN }} repo-token-user-login: 'github-actions[bot]' # The user.login for temporary GitHub token