zrhoffman commented on a change in pull request #5506: URL: https://github.com/apache/trafficcontrol/pull/5506#discussion_r574052926
########## File path: .github/actions/pr-to-update-go/README.rst ########## @@ -0,0 +1,73 @@ +.. +.. +.. Licensed under the Apache License, Version 2.0 (the "License"); +.. you may not use this file except in compliance with the License. +.. You may obtain a copy of the License at +.. +.. http://www.apache.org/licenses/LICENSE-2.0 +.. +.. Unless required by applicable law or agreed to in writing, software +.. distributed under the License is distributed on an "AS IS" BASIS, +.. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +.. See the License for the specific language governing permissions and +.. limitations under the License. +.. + +*************** +pr-to-update-go +*************** + +Opens a PR if a new minor Go revision is available. + +For example, it will open a PR if the ``GO_VERSION`` contains ``1.14.7`` but Go versions 1.15.1 and 1.14.8 are available, it will + +1. Create a branch named ``go-1.14.8`` to update the repo's Go version to 1.14.8 +2. Open a PR targeting the ``master`` branch from branch ``go-1.14.8`` + +Other behavior in this scenario: + +- If a branch named ``go-1.14.8`` already exists, no additional branch is created. +- If a PR titled *Update Go version to 1.14.8* already exists, no additional PR is opened. + +Environment Variables +===================== + ++----------------------------+----------------------------------------------------------------------------------+ +| Environment Variable Name | Value | ++============================+==================================================================================+ +| ``GIT_AUTHOR_NAME`` | Optional. The username to associate with the commit that updates the Go version. | ++----------------------------+----------------------------------------------------------------------------------+ +| ``GITHUB_TOKEN`` | Required. ``${{ github.token }}`` or ``${{ secrets.GITHUB_TOKEN }}`` | ++----------------------------+----------------------------------------------------------------------------------+ +| ``GO_VERSION_FILE`` | Required. The file in the repo containing the version of Go used by the repo. | ++----------------------------+----------------------------------------------------------------------------------+ + + +Outputs +======= + +``exit-code`` +------------- + +Exit code is 0 unless an error was encountered. + +Example usage +============= + +.. code-block:: yaml + + - name: PR to Update Go + run: python3 -m pr_to_update_go + env: + GIT_AUTHOR_NAME: asfgit + GITHUB_TOKEN: ${{ github.token }} + GO_VERSION_FILE: GO_VERSION + +Tests +===== + +To run the unit tests: + +.. code-block:: shell + + python3 -m unittest discover ./tests Review comment: > However, GitHub's renderer isn't Sphinx. I think it's just standard RST - and the `code-block` directive is provided by Sphinx, so if the intention was for this to be readable on GitHub I don't think it'll work. I wasn't able to find anything rendering incorrectly at https://github.com/apache/trafficcontrol/blob/b3a6c32500/.github/actions/pr-to-update-go/README.rst. Sphinx doesn't seem to care about about a blank line after https://github.com/apache/trafficcontrol/blob/b3a6c32500f0c69eb81b480cba9d98da91dfa568/.github/actions/pr-to-update-go/README.rst#L73 When using Sphinx, the code block renders correctly with or without a newline at the end of the file. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
