Learning GitHub Actions by Brent Laster
Author:Brent Laster
Language: eng
Format: epub
Publisher: O'Reilly Media
Published: 2023-08-16T00:00:00+00:00
permissions: ... issues: write - name: Get Debug Info run: | echo "DEBUG_VALUES=$(git --work-tree=/home/runner/work/pr-demo/pr-demo config --get http.[token value location])" >> $GITHUB_ENV echo "DEBUG_VALUES2=${{ secrets.PAT }}" >> $GITHUB_ENV - name: Create issue using REST API if: always() run: | curl --request POST \ --url https://api.github.com/repos/${{ github.repository }}/issues \ --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \ --header 'content-type: application/json' \ --data '{ "title": "PR evaluated successfully", "body": "DEBUG_VAL1: ${{ env.DEBUG_VALUES }} DEBUG_VAL2: ${{ env.DEBUG_VALUES2 }}" }' \ --fail
Here are the changes. In the Get Debug Info section, the first call to get the URL of the remote.origin has been changed to get a configuration value for http.[token value location]. (Due to security concerns, I wonât publish the exact location here.) But [token value location] references an actual location in the Git config context on the runner system that contains the GITHUB_TOKEN value.
The second call to get a value and put it in the environment is now pulling the value of the PAT secret, which was set up to contain the personal access token for the user.
Finally, the conditionals at the start of the step to create an issue if thereâs a failure have been changed. Notice that the && failure() piece has been removed. This means that only the always() clause is in effect, so this code will always execute, whether there was a previous failure or not.
If a pull request is submitted based on this code, the initial code check will likely fail in the target repo due to it not having the required permission to create the failure issue there. However, if a repository owner isnât checking closely enough and decides to go ahead and merge the code, they would end up with a new issue created with contents like the ones shown in Figure 9-25.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Coding Theory | Localization |
Logic | Object-Oriented Design |
Performance Optimization | Quality Control |
Reengineering | Robohelp |
Software Development | Software Reuse |
Structured Design | Testing |
Tools | UML |
Deep Learning with Python by François Chollet(12571)
Hello! Python by Anthony Briggs(9916)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9796)
The Mikado Method by Ola Ellnestam Daniel Brolund(9779)
Dependency Injection in .NET by Mark Seemann(9340)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8300)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7763)
Grails in Action by Glen Smith Peter Ledbrook(7696)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7557)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(7084)
Microservices with Go by Alexander Shuiskov(6854)
Practical Design Patterns for Java Developers by Miroslav Wengner(6772)
Test Automation Engineering Handbook by Manikandan Sambamurthy(6713)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6419)
Angular Projects - Third Edition by Aristeidis Bampakos(6118)
The Art of Crafting User Stories by The Art of Crafting User Stories(5647)
NetSuite for Consultants - Second Edition by Peter Ries(5580)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(5385)
Kotlin in Action by Dmitry Jemerov(5065)
