From cd383414c96f7ce4ae30924411863bca910fd447 Mon Sep 17 00:00:00 2001 From: Matthew Davis <38021615+mattdavis0351@users.noreply.github.com> Date: Mon, 23 Mar 2020 21:07:41 -0700 Subject: [PATCH 01/43] Create LICENSE --- LICENSE | 395 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 395 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..4ea99c2 --- /dev/null +++ b/LICENSE @@ -0,0 +1,395 @@ +Attribution 4.0 International + +======================================================================= + +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution 4.0 International Public License ("Public License"). To the +extent this Public License may be interpreted as a contract, You are +granted the Licensed Rights in consideration of Your acceptance of +these terms and conditions, and the Licensor grants You such rights in +consideration of benefits the Licensor receives from making the +Licensed Material available under these terms and conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + d. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + e. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + f. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + g. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + h. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + i. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + j. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + k. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part; and + + b. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + 4. If You Share Adapted Material You produce, the Adapter's + License You apply must not prevent recipients of the Adapted + Material from complying with this Public License. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material; and + + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + + +======================================================================= + +Creative Commons is not a party to its public +licenses. Notwithstanding, Creative Commons may elect to apply one of +its public licenses to material it publishes and in those instances +will be considered the “Licensor.” The text of the Creative Commons +public licenses is dedicated to the public domain under the CC0 Public +Domain Dedication. Except for the limited purpose of indicating that +material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the +public licenses. + +Creative Commons may be contacted at creativecommons.org. From a4e950c6808f4d82d536d0bd67acd8a6d2bbd5b5 Mon Sep 17 00:00:00 2001 From: mattdavis0351 Date: Tue, 24 Mar 2020 16:57:45 -0700 Subject: [PATCH 02/43] update course-details.md --- course-details.md | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/course-details.md b/course-details.md index 629148e..07079ff 100644 --- a/course-details.md +++ b/course-details.md @@ -1,9 +1,35 @@ -This is the description we show on the course page [here](https://lab.github.com/githubtraining/write-github-script). This first paragraph will be featured at the top of the page so make it great. -​ +[GitHub Script](https://github.com/actions/github-script) is a special action that allows using [octokit/rest.js](https://octokit.github.io/rest.js/v17) directly in a workflow file. -​ -Be sure to tell the learner about the technology you are teaching, why they should learn it, how they can use it, and what you will teach them. -​ +Over the duration of this course you will learn the skills needed to begin using the GitHub Script action to interact with your repository which will save you from creating full blown actions that carry unnecessary overhead. +## What you'll learn -Include information on how they can reach you for questions about the content or course. \ No newline at end of file +In this course you will learn how to: + +- Use GitHub Script in your workflow +- Comment on issues using octokit +- Add issues to a project board using octokit +- Use the workflow expression syntax to filter when jobs run in a workflow. + +## What you'll build + +![Need Screenshot](https://user-images.githubusercontent.com/38021615/77487200-124f0000-6def-11ea-9622-813e5ed08d95.png) + +In this course you will automatically generate a comment on every new issue using a templated response. Additionally, if this issue is labeled as a bug it will be automatically added to the "needs triage" column of a project board. + +## Prerequisites + +We first recommend taking the following courses: + +- [Hello, GitHub Actions!](https://lab.github.com/github/hello-github-actions!) to learn the basics of how GitHub Actions work +- [GitHub Actions: Continuous Integration](https://lab.github.com/githubtraining/github-actions:-continuous-integration) to dive deeper into a workflow file + +## Projects used + +This makes use of the following open source projects. Consider exploring these repos and maybe even making contributions! + +- [GitHub Script](https://github.com/actions/github-script), a unique action that provides an authenticated octokit client and allows JavaScript to be written directly in a workflow file. + +## Audience + +Developers, DevOps Engineers, students, teams From 9afb6f03ec25990a2aaad36b958aeb1d6f08f1c5 Mon Sep 17 00:00:00 2001 From: mattdavis0351 Date: Wed, 25 Mar 2020 14:06:29 -0700 Subject: [PATCH 03/43] store test --- config.yml | 132 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 75 insertions(+), 57 deletions(-) diff --git a/config.yml b/config.yml index 1c837f8..5afe2aa 100644 --- a/config.yml +++ b/config.yml @@ -14,39 +14,51 @@ before: columns: - Triage Backlog - Triage Complete + - type: createIssue title: Start here! body: 00_welcome-issue.md - action_id: welcomeIssue - - type: respond - with: 00_explain-gh-script.md - issue: "%actions.welcomeIssue.data.number%" - - type: respond - with: 00_octokit-comparison.md - issue: "%actions.welcomeIssue.data.number%" - - type: respond - issue: "%actions.welcomeIssue.data.number%" - with: 00_welcome-activity.md + store: + firstIssueUrl: "%result.data.issue.html_url%" + firstIssueNumber: "%result.data.issue.number%" data: quicklink: "%payload.repository.html_url%/new/master?filename=.github/workflows/my-workflow.yml" actionsUrl: "%payload.repository.html_url%/actions/new" + comments: + - 00_explain-gh-script.md + - 00_octokit-comparison.md + - 00_welcome-activity.md + # - type: respond + # with: 00_explain-gh-script.md + # issue: "%actions.welcomeIssue.data.number%" + # - type: respond + # with: 00_octokit-comparison.md + # issue: "%actions.welcomeIssue.data.number%" + # - type: respond + # issue: "%actions.welcomeIssue.data.number%" + # with: 00_welcome-activity.md + # data: + # quicklink: "%payload.repository.html_url%/new/master?filename=.github/workflows/my-workflow.yml" + # actionsUrl: "%payload.repository.html_url%/actions/new" steps: - title: Setup a workflow file description: Create a pull request to add a workflow - event: pull_request - link: "{{ repoUrl }}/issues/1" + event: + - pull_request.opened + - pull_request.edited + link: "{{store.firstIssueUrl}}" actions: - - type: gate - gates: - # if the payload action is 'opened' OR 'edited' - - left: "%payload.action%" - operator: === - right: opened - - left: "%payload.action%" - operator: === - right: edited - # AND the pull request title equals 'Create my-workflow.yml' + # - type: gate + # gates: + # # if the payload action is 'opened' OR 'edited' + # - left: "%payload.action%" + # operator: === + # right: opened + # - left: "%payload.action%" + # operator: === + # right: edited + # # AND the pull request title equals 'Create my-workflow.yml' - type: gate left: "%payload.pull_request.title%" operator: === @@ -84,43 +96,50 @@ steps: with: e-wrong-file-location.md data: haveFile: "%actions.fileLocation.path%" - needFile: ".github/actions/cat-facts/action.yml" + needFile: ".github/workflows/my-workflow.yml" editLink: "%payload.repository.html_url%/edit/%payload.pull_request.head.ref%/%actions.fileLocation.path%" fileName: my-workflow.yml # End filepath verification ####################################################### - type: respond - issue: Start here! + issue: "{{store.firstIssueNumber}}" with: new-pull-request.md data: pullUrl: "%payload.pull_request.html_url%" - type: closeIssue - issue: Start here! + issue: "{{store.firstIssueNumber}}" - type: createReview body: 01_merge-workflow.md event: APPROVE + store: + firstPullUrl: "%result.data.pull_request.html_url%" + firstPullNumber: "%result.data.pull_request.number%" data: actionsUrl: "%payload.repository.html_url%/actions" - title: Merge the new workflow into the master branch description: Make the workflow available for use on the repository event: pull_request.closed - link: "{{ repoUrl }}/pull/2" + link: "{{store.firstPullUrl}}" actions: - type: createIssue title: Create an issue comment with GitHub Script body: 02_workflow-triggered.md action_id: triggerIssue + store: + secondIssueNumber: "%result.data.issue.number%" + secondIssueUrl: "%result.data.issue.html_url%" - type: respond with: new-issue.md - issue: Create my-workflow.yml + issue: "%store.firstPullNumber%" data: - issueURL: "%actions.triggerIssue.data.html_url%" + issueURL: "%store.firstPullUrl%" - title: Add another GitHub Script action description: Use GitHub Script to place this issue into a project board - event: check_suite.completed - link: "{{repoUrl}}/issues/3" + # event: check_suite.completed # issue_comment.created/edited + event: issue_comment.created + link: "{{store.secondIssueUrl}}" actions: - type: gate left: "%payload.check_suite.app.name%" @@ -128,13 +147,13 @@ steps: right: "GitHub Actions" else: - type: respond - issue: 3 + issue: "{{store.secondIssueNumber}}" with: debug.md data: debug: "%payload%" - type: respond with: 03_workflow-success.md - issue: 3 + issue: "{{store.secondIssueNumber}}" - type: octokit method: projects.listForRepo owner: "%payload.repository.owner.login%" @@ -146,7 +165,7 @@ steps: action_id: listColumns - type: respond with: 03_add-to-projects.md - issue: 3 + issue: "{{store.secondIssueNumber}}" data: listProj: "%actions.projectBoard.data%" listCol: "%actions.listColumns.data%" @@ -155,19 +174,11 @@ steps: # new pull request - title: Modify your workflow file description: Create a pull request to add changes to your workflow - event: pull_request - link: "{{ repoUrl }}/pull/4" + event: + - pull_request.opened + - pull_request.edited + link: "{{ store.secondIssueUrl }}" actions: - - type: gate - gates: - # if the payload action is 'opened' OR 'edited' - - left: "%payload.action%" - operator: === - right: opened - - left: "%payload.action%" - operator: === - right: edited - # AND the pull request title equals 'Create my-workflow.yml' - type: gate left: "%payload.pull_request.title%" operator: === @@ -211,37 +222,44 @@ steps: # End filepath verification ####################################################### - type: respond - issue: 3 + issue: "{{store.secondIssueNumber}}" with: new-pull-request.md data: pullUrl: "%payload.pull_request.html_url%" - type: closeIssue - issue: 3 + issue: "{{store.secondIssueNumber}}" - type: createReview body: 04_merge-workflow.md event: APPROVE + store: + secondPullNumber: "%result.data.pull_request.number%" + secondPullUrl: "%result.data.pull_request.html_url%" data: actionsUrl: "%payload.repository.html_url%/actions" - title: Merge the new workflow into the master branch description: Make the workflow available for use on the repository event: pull_request.closed - link: "{{ repoUrl }}/issues/5" + link: "{{ store.secondPullUrl }}" actions: - type: createIssue title: Create an issue comment with GitHub Script body: 05_workflow-triggered.md action_id: triggerIssue + store: + thirdIssueUrl: "%result.data.issue.html_url%" + thirdIssueNumber: "%result.data.issue.number%" - type: respond with: new-issue.md - issue: Update my-workflow.yml + issue: "{{store.secondPullNumber}}" data: - issueURL: "%actions.triggerIssue.data.html_url%" + issueURL: "{{store.thirdIssueUrl}}" - title: Break your workflow into multiple steps description: Separate the workflow concerns by adding more steps - event: check_suite.completed - link: "{{repoUrl}}/issues/5" + # event: check_suite.completed + event: issue_comment.created + link: "{{thirdIssueUlr}}" actions: - type: gate left: "%payload.check_suite.app.name%" @@ -249,7 +267,7 @@ steps: right: "GitHub Actions" else: - type: respond - issue: 5 + issue: "{{store.thirdIssueNumber}}" with: debug.md data: debug: "%payload%" @@ -264,12 +282,12 @@ steps: action_id: listColumns - type: respond with: 06_steps-overview.md - issue: 5 + issue: "{{store.thirdIssueNumber}}" data: projectTab: "%payload.repository.html_url%/projects/1" - type: respond with: 06_steps-activity.md - issue: 5 + issue: "{{store.thirdIssueNumber}}" data: listProj: "%actions.projectBoard.data%" listCol: "%actions.listColumns.data%" @@ -292,12 +310,12 @@ steps: project_id: "%actions.projectBoard.data.0.id%" action_id: listColumns - type: respond - issue: 5 + issue: "{{store.thirdIssueNumber}}" with: new-pull-request.md data: pullUrl: "%payload.pull_request.html_url%" - type: closeIssue - issue: 5 + issue: "{{store.thirdIssueNumber}}" - type: respond with: 07_explain-node.md - type: respond From c9cb46d6fea8b82a91b3643cce158004ff385724 Mon Sep 17 00:00:00 2001 From: mattdavis0351 Date: Wed, 25 Mar 2020 14:10:43 -0700 Subject: [PATCH 04/43] store test --- config.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/config.yml b/config.yml index 5afe2aa..1a84208 100644 --- a/config.yml +++ b/config.yml @@ -19,8 +19,8 @@ before: title: Start here! body: 00_welcome-issue.md store: - firstIssueUrl: "%result.data.issue.html_url%" - firstIssueNumber: "%result.data.issue.number%" + welcomeIssueUrl: "%payload.data.issue.html_url%" + welcomeIssueNumber: "%payload.data.issue.number%" data: quicklink: "%payload.repository.html_url%/new/master?filename=.github/workflows/my-workflow.yml" actionsUrl: "%payload.repository.html_url%/actions/new" @@ -47,7 +47,7 @@ steps: event: - pull_request.opened - pull_request.edited - link: "{{store.firstIssueUrl}}" + link: "{{store.welcomeIssueUrl}}" actions: # - type: gate # gates: @@ -102,18 +102,18 @@ steps: # End filepath verification ####################################################### - type: respond - issue: "{{store.firstIssueNumber}}" + issue: "{{store.welcomeIssueNumber}}" with: new-pull-request.md data: pullUrl: "%payload.pull_request.html_url%" - type: closeIssue - issue: "{{store.firstIssueNumber}}" + issue: "{{store.welcomeIssueNumber}}" - type: createReview body: 01_merge-workflow.md event: APPROVE store: - firstPullUrl: "%result.data.pull_request.html_url%" - firstPullNumber: "%result.data.pull_request.number%" + firstPullUrl: "%payload.data.pull_request.html_url%" + firstPullNumber: "%payload.data.pull_request.number%" data: actionsUrl: "%payload.repository.html_url%/actions" @@ -127,8 +127,8 @@ steps: body: 02_workflow-triggered.md action_id: triggerIssue store: - secondIssueNumber: "%result.data.issue.number%" - secondIssueUrl: "%result.data.issue.html_url%" + secondIssueNumber: "%payload.data.issue.number%" + secondIssueUrl: "%payload.data.issue.html_url%" - type: respond with: new-issue.md issue: "%store.firstPullNumber%" @@ -232,8 +232,8 @@ steps: body: 04_merge-workflow.md event: APPROVE store: - secondPullNumber: "%result.data.pull_request.number%" - secondPullUrl: "%result.data.pull_request.html_url%" + secondPullNumber: "%payload.data.pull_request.number%" + secondPullUrl: "%payload.data.pull_request.html_url%" data: actionsUrl: "%payload.repository.html_url%/actions" @@ -247,8 +247,8 @@ steps: body: 05_workflow-triggered.md action_id: triggerIssue store: - thirdIssueUrl: "%result.data.issue.html_url%" - thirdIssueNumber: "%result.data.issue.number%" + thirdIssueUrl: "%payload.data.issue.html_url%" + thirdIssueNumber: "%payload.data.issue.number%" - type: respond with: new-issue.md issue: "{{store.secondPullNumber}}" From 189aba9b245409fc517389ee580b7130dcfc32bb Mon Sep 17 00:00:00 2001 From: mattdavis0351 Date: Wed, 25 Mar 2020 14:16:18 -0700 Subject: [PATCH 05/43] store test --- config.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/config.yml b/config.yml index 1a84208..01be814 100644 --- a/config.yml +++ b/config.yml @@ -19,8 +19,8 @@ before: title: Start here! body: 00_welcome-issue.md store: - welcomeIssueUrl: "%payload.data.issue.html_url%" - welcomeIssueNumber: "%payload.data.issue.number%" + welcomeIssueUrl: "%payload.issue.html_url%" + welcomeIssueNumber: "%payload.issue.number%" data: quicklink: "%payload.repository.html_url%/new/master?filename=.github/workflows/my-workflow.yml" actionsUrl: "%payload.repository.html_url%/actions/new" @@ -112,8 +112,8 @@ steps: body: 01_merge-workflow.md event: APPROVE store: - firstPullUrl: "%payload.data.pull_request.html_url%" - firstPullNumber: "%payload.data.pull_request.number%" + firstPullUrl: "%payload.pull_request.html_url%" + firstPullNumber: "%payload.pull_request.number%" data: actionsUrl: "%payload.repository.html_url%/actions" @@ -127,8 +127,8 @@ steps: body: 02_workflow-triggered.md action_id: triggerIssue store: - secondIssueNumber: "%payload.data.issue.number%" - secondIssueUrl: "%payload.data.issue.html_url%" + secondIssueNumber: "%payload.issue.number%" + secondIssueUrl: "%payload.issue.html_url%" - type: respond with: new-issue.md issue: "%store.firstPullNumber%" @@ -232,8 +232,8 @@ steps: body: 04_merge-workflow.md event: APPROVE store: - secondPullNumber: "%payload.data.pull_request.number%" - secondPullUrl: "%payload.data.pull_request.html_url%" + secondPullNumber: "%payload.pull_request.number%" + secondPullUrl: "%payload.pull_request.html_url%" data: actionsUrl: "%payload.repository.html_url%/actions" @@ -247,8 +247,8 @@ steps: body: 05_workflow-triggered.md action_id: triggerIssue store: - thirdIssueUrl: "%payload.data.issue.html_url%" - thirdIssueNumber: "%payload.data.issue.number%" + thirdIssueUrl: "%payload.issue.html_url%" + thirdIssueNumber: "%payload.issue.number%" - type: respond with: new-issue.md issue: "{{store.secondPullNumber}}" From 6b61ae79ab56883d7fa347a8be9be0eeee3cb19c Mon Sep 17 00:00:00 2001 From: mattdavis0351 Date: Wed, 25 Mar 2020 16:45:30 -0700 Subject: [PATCH 06/43] checking store --- config.yml | 32 ++++++++++++-------------------- responses/e-result.md | 3 +++ 2 files changed, 15 insertions(+), 20 deletions(-) create mode 100644 responses/e-result.md diff --git a/config.yml b/config.yml index 01be814..89a2ed8 100644 --- a/config.yml +++ b/config.yml @@ -19,8 +19,9 @@ before: title: Start here! body: 00_welcome-issue.md store: - welcomeIssueUrl: "%payload.issue.html_url%" - welcomeIssueNumber: "%payload.issue.number%" + welcomeIssueUrl: "%result.data.html_url%" + welcomeIssueNumber: "%result.data.number%" + createIssueResult: "%result%" data: quicklink: "%payload.repository.html_url%/new/master?filename=.github/workflows/my-workflow.yml" actionsUrl: "%payload.repository.html_url%/actions/new" @@ -28,6 +29,7 @@ before: - 00_explain-gh-script.md - 00_octokit-comparison.md - 00_welcome-activity.md + - e-result.md # - type: respond # with: 00_explain-gh-script.md # issue: "%actions.welcomeIssue.data.number%" @@ -49,16 +51,6 @@ steps: - pull_request.edited link: "{{store.welcomeIssueUrl}}" actions: - # - type: gate - # gates: - # # if the payload action is 'opened' OR 'edited' - # - left: "%payload.action%" - # operator: === - # right: opened - # - left: "%payload.action%" - # operator: === - # right: edited - # # AND the pull request title equals 'Create my-workflow.yml' - type: gate left: "%payload.pull_request.title%" operator: === @@ -112,8 +104,8 @@ steps: body: 01_merge-workflow.md event: APPROVE store: - firstPullUrl: "%payload.pull_request.html_url%" - firstPullNumber: "%payload.pull_request.number%" + firstPullUrl: "%result.data.html_url%" + firstPullNumber: "%result.data.number%" data: actionsUrl: "%payload.repository.html_url%/actions" @@ -127,8 +119,8 @@ steps: body: 02_workflow-triggered.md action_id: triggerIssue store: - secondIssueNumber: "%payload.issue.number%" - secondIssueUrl: "%payload.issue.html_url%" + secondIssueNumber: "%result.data.number%" + secondIssueUrl: "%result.data.html_url%" - type: respond with: new-issue.md issue: "%store.firstPullNumber%" @@ -232,8 +224,8 @@ steps: body: 04_merge-workflow.md event: APPROVE store: - secondPullNumber: "%payload.pull_request.number%" - secondPullUrl: "%payload.pull_request.html_url%" + secondPullNumber: "%result.data.number%" + secondPullUrl: "%result.data.html_url%" data: actionsUrl: "%payload.repository.html_url%/actions" @@ -247,8 +239,8 @@ steps: body: 05_workflow-triggered.md action_id: triggerIssue store: - thirdIssueUrl: "%payload.issue.html_url%" - thirdIssueNumber: "%payload.issue.number%" + thirdIssueUrl: "%result.data.html_url%" + thirdIssueNumber: "%result.data.number%" - type: respond with: new-issue.md issue: "{{store.secondPullNumber}}" diff --git a/responses/e-result.md b/responses/e-result.md new file mode 100644 index 0000000..bbaee5d --- /dev/null +++ b/responses/e-result.md @@ -0,0 +1,3 @@ +# store result contents + +{{store.createIssueResult}} From ee3591349ad542856948381e26f9eb820fb94dba Mon Sep 17 00:00:00 2001 From: mattdavis0351 Date: Wed, 25 Mar 2020 16:47:09 -0700 Subject: [PATCH 07/43] typo fix --- config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.yml b/config.yml index 89a2ed8..ba6ccd7 100644 --- a/config.yml +++ b/config.yml @@ -251,7 +251,7 @@ steps: description: Separate the workflow concerns by adding more steps # event: check_suite.completed event: issue_comment.created - link: "{{thirdIssueUlr}}" + link: "{{thirdIssueUrl}}" actions: - type: gate left: "%payload.check_suite.app.name%" From 0b2e0f044779819647a3b69a35430fda52f33222 Mon Sep 17 00:00:00 2001 From: mattdavis0351 Date: Wed, 25 Mar 2020 16:47:54 -0700 Subject: [PATCH 08/43] typo fix --- config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.yml b/config.yml index ba6ccd7..8712822 100644 --- a/config.yml +++ b/config.yml @@ -251,7 +251,7 @@ steps: description: Separate the workflow concerns by adding more steps # event: check_suite.completed event: issue_comment.created - link: "{{thirdIssueUrl}}" + link: "{{store.thirdIssueUrl}}" actions: - type: gate left: "%payload.check_suite.app.name%" From b073086e8e7fc871d73bd086ac97d7c5de7dc4e0 Mon Sep 17 00:00:00 2001 From: mattdavis0351 Date: Wed, 25 Mar 2020 17:00:53 -0700 Subject: [PATCH 09/43] remove store in before --- config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.yml b/config.yml index 8712822..c07f9ac 100644 --- a/config.yml +++ b/config.yml @@ -21,7 +21,7 @@ before: store: welcomeIssueUrl: "%result.data.html_url%" welcomeIssueNumber: "%result.data.number%" - createIssueResult: "%result%" + # createIssueResult: "%result%" data: quicklink: "%payload.repository.html_url%/new/master?filename=.github/workflows/my-workflow.yml" actionsUrl: "%payload.repository.html_url%/actions/new" @@ -29,7 +29,7 @@ before: - 00_explain-gh-script.md - 00_octokit-comparison.md - 00_welcome-activity.md - - e-result.md + # - e-result.md # - type: respond # with: 00_explain-gh-script.md # issue: "%actions.welcomeIssue.data.number%" From a9b78c4912dcab93341f523697564083a2a8ecf7 Mon Sep 17 00:00:00 2001 From: mattdavis0351 Date: Wed, 25 Mar 2020 17:02:31 -0700 Subject: [PATCH 10/43] add reslut.data back --- config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.yml b/config.yml index c07f9ac..a457346 100644 --- a/config.yml +++ b/config.yml @@ -21,7 +21,7 @@ before: store: welcomeIssueUrl: "%result.data.html_url%" welcomeIssueNumber: "%result.data.number%" - # createIssueResult: "%result%" + createIssueResult: "%result.data%" data: quicklink: "%payload.repository.html_url%/new/master?filename=.github/workflows/my-workflow.yml" actionsUrl: "%payload.repository.html_url%/actions/new" @@ -29,7 +29,7 @@ before: - 00_explain-gh-script.md - 00_octokit-comparison.md - 00_welcome-activity.md - # - e-result.md + - e-result.md # - type: respond # with: 00_explain-gh-script.md # issue: "%actions.welcomeIssue.data.number%" From ec9f6200f37ff1c4ffd75c946cfce84dca951432 Mon Sep 17 00:00:00 2001 From: mattdavis0351 Date: Wed, 25 Mar 2020 17:06:46 -0700 Subject: [PATCH 11/43] no use of result.data to find what it looks like --- responses/e-result.md | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 responses/e-result.md diff --git a/responses/e-result.md b/responses/e-result.md deleted file mode 100644 index bbaee5d..0000000 --- a/responses/e-result.md +++ /dev/null @@ -1,3 +0,0 @@ -# store result contents - -{{store.createIssueResult}} From 0a358341e2d43e416b0be80268bb172b094e7707 Mon Sep 17 00:00:00 2001 From: mattdavis0351 Date: Wed, 25 Mar 2020 17:11:35 -0700 Subject: [PATCH 12/43] broke again --- config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.yml b/config.yml index a457346..25d7077 100644 --- a/config.yml +++ b/config.yml @@ -21,7 +21,7 @@ before: store: welcomeIssueUrl: "%result.data.html_url%" welcomeIssueNumber: "%result.data.number%" - createIssueResult: "%result.data%" + # createIssueResult: "%result.data%" data: quicklink: "%payload.repository.html_url%/new/master?filename=.github/workflows/my-workflow.yml" actionsUrl: "%payload.repository.html_url%/actions/new" @@ -29,7 +29,7 @@ before: - 00_explain-gh-script.md - 00_octokit-comparison.md - 00_welcome-activity.md - - e-result.md + # - e-result.md # - type: respond # with: 00_explain-gh-script.md # issue: "%actions.welcomeIssue.data.number%" From 1b9d44c33541c6cfe312655f68f7f418b3c4fe74 Mon Sep 17 00:00:00 2001 From: mattdavis0351 Date: Wed, 25 Mar 2020 17:28:17 -0700 Subject: [PATCH 13/43] add registration.store --- config.yml | 2 +- responses/e-result.md | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 responses/e-result.md diff --git a/config.yml b/config.yml index 25d7077..b4b2376 100644 --- a/config.yml +++ b/config.yml @@ -94,7 +94,7 @@ steps: # End filepath verification ####################################################### - type: respond - issue: "{{store.welcomeIssueNumber}}" + issue: "{{registration.store.welcomeIssueNumber}}" with: new-pull-request.md data: pullUrl: "%payload.pull_request.html_url%" diff --git a/responses/e-result.md b/responses/e-result.md new file mode 100644 index 0000000..a8fffe1 --- /dev/null +++ b/responses/e-result.md @@ -0,0 +1,3 @@ +# view result + +{{store.createIssueResult}} From 115ac1d5f161bb9d22245c09086c092af7702854 Mon Sep 17 00:00:00 2001 From: mattdavis0351 Date: Wed, 25 Mar 2020 17:36:41 -0700 Subject: [PATCH 14/43] template fixing --- config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.yml b/config.yml index b4b2376..dd993b0 100644 --- a/config.yml +++ b/config.yml @@ -94,7 +94,7 @@ steps: # End filepath verification ####################################################### - type: respond - issue: "{{registration.store.welcomeIssueNumber}}" + issue: "%registration.store.welcomeIssueNumber%" with: new-pull-request.md data: pullUrl: "%payload.pull_request.html_url%" From 380126d7a0e749c6b3ecd665ef9e452484c817e2 Mon Sep 17 00:00:00 2001 From: mattdavis0351 Date: Wed, 25 Mar 2020 18:16:20 -0700 Subject: [PATCH 15/43] more store testing --- config.yml | 79 ++++++++++++++++++++----------------------- responses/e-result.md | 3 -- 2 files changed, 37 insertions(+), 45 deletions(-) delete mode 100644 responses/e-result.md diff --git a/config.yml b/config.yml index dd993b0..22022bc 100644 --- a/config.yml +++ b/config.yml @@ -14,14 +14,12 @@ before: columns: - Triage Backlog - Triage Complete - - type: createIssue title: Start here! body: 00_welcome-issue.md store: welcomeIssueUrl: "%result.data.html_url%" welcomeIssueNumber: "%result.data.number%" - # createIssueResult: "%result.data%" data: quicklink: "%payload.repository.html_url%/new/master?filename=.github/workflows/my-workflow.yml" actionsUrl: "%payload.repository.html_url%/actions/new" @@ -29,19 +27,6 @@ before: - 00_explain-gh-script.md - 00_octokit-comparison.md - 00_welcome-activity.md - # - e-result.md - # - type: respond - # with: 00_explain-gh-script.md - # issue: "%actions.welcomeIssue.data.number%" - # - type: respond - # with: 00_octokit-comparison.md - # issue: "%actions.welcomeIssue.data.number%" - # - type: respond - # issue: "%actions.welcomeIssue.data.number%" - # with: 00_welcome-activity.md - # data: - # quicklink: "%payload.repository.html_url%/new/master?filename=.github/workflows/my-workflow.yml" - # actionsUrl: "%payload.repository.html_url%/actions/new" steps: - title: Setup a workflow file @@ -68,26 +53,32 @@ steps: # Validate the filepath for the my-workflow.yml file # get tree - type: getTree - action_id: isInTree + # action_id: isInTree + store: + firstWorkflowTree: "%result.data.tree%" recursive: true sha: "%payload.pull_request.head.sha%" # check for a file in a tree - type: gate - left: "%actions.isInTree.data.tree%" + # left: "%actions.isInTree.data.tree%" + left: "%registration.store.firstWorkflowTree%" operator: includes right: "path:.github/workflows/my-workflow.yml" else: # if file isn't where expected find true location - type: findInTree path: my-workflow.yml - tree: "%actions.isInTree.data.tree%" - # multiple: true - action_id: fileLocation + # tree: "%actions.isInTree.data.tree%" + tree: "%registration.store.firstWorkflowTree%" + # action_id: fileLocation + store: + firstFileLocation: "%result.data.path%" # help user with proper file location - type: respond with: e-wrong-file-location.md data: - haveFile: "%actions.fileLocation.path%" + # haveFile: "%actions.fileLocation.path%" + haveFile: "%registration.store.firstFileLocation%" needFile: ".github/workflows/my-workflow.yml" editLink: "%payload.repository.html_url%/edit/%payload.pull_request.head.ref%/%actions.fileLocation.path%" fileName: my-workflow.yml @@ -99,7 +90,7 @@ steps: data: pullUrl: "%payload.pull_request.html_url%" - type: closeIssue - issue: "{{store.welcomeIssueNumber}}" + issue: "%registration.store.welcomeIssueNumber%" - type: createReview body: 01_merge-workflow.md event: APPROVE @@ -117,15 +108,15 @@ steps: - type: createIssue title: Create an issue comment with GitHub Script body: 02_workflow-triggered.md - action_id: triggerIssue + # action_id: triggerIssue store: secondIssueNumber: "%result.data.number%" secondIssueUrl: "%result.data.html_url%" - type: respond with: new-issue.md - issue: "%store.firstPullNumber%" + issue: "%registration.store.firstPullNumber%" data: - issueURL: "%store.firstPullUrl%" + issueURL: "%registration.store.firstPullUrl%" - title: Add another GitHub Script action description: Use GitHub Script to place this issue into a project board @@ -139,29 +130,33 @@ steps: right: "GitHub Actions" else: - type: respond - issue: "{{store.secondIssueNumber}}" + issue: "%registration.store.secondIssueNumber%" with: debug.md data: debug: "%payload%" - type: respond with: 03_workflow-success.md - issue: "{{store.secondIssueNumber}}" + issue: "%registration.store.secondIssueNumber%" - type: octokit method: projects.listForRepo owner: "%payload.repository.owner.login%" repo: "%payload.repository.name%" - action_id: projectBoard + # action_id: projectBoard + store: + projectBoard: "%result.data.0.id%" - type: octokit method: projects.listColumns - project_id: "%actions.projectBoard.data.0.id%" + # project_id: "%actions.projectBoard.data.0.id%" + project_id: "%registration.store.projectBoard%" action_id: listColumns + store: + listColumns: "%result.data.0.id" - type: respond with: 03_add-to-projects.md - issue: "{{store.secondIssueNumber}}" + issue: "%registration.store.secondIssueNumber%" data: - listProj: "%actions.projectBoard.data%" - listCol: "%actions.listColumns.data%" - columnID: "%actions.listColumns.data.0.id%" + # columnID: "%actions.listColumns.data.0.id%" + columnID: "%registration.store.listColumns%" quicklink: "%payload.repository.html_url%/edit/master/.github/workflows/my-workflow.yml" # new pull request - title: Modify your workflow file @@ -214,12 +209,12 @@ steps: # End filepath verification ####################################################### - type: respond - issue: "{{store.secondIssueNumber}}" + issue: "%registration.store.secondIssueNumber%" with: new-pull-request.md data: pullUrl: "%payload.pull_request.html_url%" - type: closeIssue - issue: "{{store.secondIssueNumber}}" + issue: "%registration.store.secondIssueNumber%" - type: createReview body: 04_merge-workflow.md event: APPROVE @@ -243,9 +238,9 @@ steps: thirdIssueNumber: "%result.data.number%" - type: respond with: new-issue.md - issue: "{{store.secondPullNumber}}" + issue: "%registration.store.secondPullNumber%" data: - issueURL: "{{store.thirdIssueUrl}}" + issueURL: "%registration.store.thirdIssueUrl%" - title: Break your workflow into multiple steps description: Separate the workflow concerns by adding more steps @@ -259,7 +254,7 @@ steps: right: "GitHub Actions" else: - type: respond - issue: "{{store.thirdIssueNumber}}" + issue: "%registration.store.thirdIssueNumber%" with: debug.md data: debug: "%payload%" @@ -274,12 +269,12 @@ steps: action_id: listColumns - type: respond with: 06_steps-overview.md - issue: "{{store.thirdIssueNumber}}" + issue: "%registration.store.thirdIssueNumber%" data: projectTab: "%payload.repository.html_url%/projects/1" - type: respond with: 06_steps-activity.md - issue: "{{store.thirdIssueNumber}}" + issue: "%registration.store.thirdIssueNumber%" data: listProj: "%actions.projectBoard.data%" listCol: "%actions.listColumns.data%" @@ -302,12 +297,12 @@ steps: project_id: "%actions.projectBoard.data.0.id%" action_id: listColumns - type: respond - issue: "{{store.thirdIssueNumber}}" + issue: "%registration.store.thirdIssueNumber%" with: new-pull-request.md data: pullUrl: "%payload.pull_request.html_url%" - type: closeIssue - issue: "{{store.thirdIssueNumber}}" + issue: "%registration.store.thirdIssueNumber%" - type: respond with: 07_explain-node.md - type: respond diff --git a/responses/e-result.md b/responses/e-result.md deleted file mode 100644 index a8fffe1..0000000 --- a/responses/e-result.md +++ /dev/null @@ -1,3 +0,0 @@ -# view result - -{{store.createIssueResult}} From abe60a68939005d5ae0cccacc904091c679eba28 Mon Sep 17 00:00:00 2001 From: mattdavis0351 Date: Wed, 25 Mar 2020 18:26:35 -0700 Subject: [PATCH 16/43] check getTree store vs action_id --- config.yml | 7 ++++++- responses/e-result.md | 7 +++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 responses/e-result.md diff --git a/config.yml b/config.yml index 22022bc..b63f5ed 100644 --- a/config.yml +++ b/config.yml @@ -53,11 +53,16 @@ steps: # Validate the filepath for the my-workflow.yml file # get tree - type: getTree - # action_id: isInTree + action_id: isInTree store: firstWorkflowTree: "%result.data.tree%" recursive: true sha: "%payload.pull_request.head.sha%" + - type: respond + with: e-result.md + data: + resultData: "%registration.store.firstWorkflowTree%" + actionIdData: "%actions.isInTree.data.tree%" # check for a file in a tree - type: gate # left: "%actions.isInTree.data.tree%" diff --git a/responses/e-result.md b/responses/e-result.md new file mode 100644 index 0000000..d54739a --- /dev/null +++ b/responses/e-result.md @@ -0,0 +1,7 @@ +# action_id + +{{actionIdData}} + +# result + +{{resultData}} From ee53c33dc57a7cdee6597ba704d82379296033fe Mon Sep 17 00:00:00 2001 From: mattdavis0351 Date: Thu, 26 Mar 2020 11:54:38 -0700 Subject: [PATCH 17/43] more prep for release --- config.yml | 28 ++++++++++------------------ responses/00_welcome-activity.md | 2 +- responses/01_merge-workflow.md | 6 +++--- responses/03_add-to-projects.md | 2 ++ responses/04_merge-workflow.md | 2 ++ responses/06_steps-activity.md | 2 ++ responses/07_use-fs.md | 2 ++ responses/08_merge-workflow.md | 2 ++ responses/09_issue-activity.md | 2 ++ server-installation-notes.md | 24 ++++++++++++++++++++++++ 10 files changed, 50 insertions(+), 22 deletions(-) create mode 100644 server-installation-notes.md diff --git a/config.yml b/config.yml index b63f5ed..2b45f26 100644 --- a/config.yml +++ b/config.yml @@ -2,6 +2,11 @@ title: "GitHub Actions: Using GitHub Script" description: >- This course covers how to use GitHub Script to quickly use octokit/rest in a GitHub Actions workflow. +tags: + - GitHub Actions + - Octokit + - Workflow + - Automation template: repo: write-github-script-template name: write-github-script @@ -54,36 +59,24 @@ steps: # get tree - type: getTree action_id: isInTree - store: - firstWorkflowTree: "%result.data.tree%" recursive: true sha: "%payload.pull_request.head.sha%" - - type: respond - with: e-result.md - data: - resultData: "%registration.store.firstWorkflowTree%" - actionIdData: "%actions.isInTree.data.tree%" # check for a file in a tree - type: gate - # left: "%actions.isInTree.data.tree%" - left: "%registration.store.firstWorkflowTree%" + left: "%actions.isInTree.data.tree%" operator: includes right: "path:.github/workflows/my-workflow.yml" else: # if file isn't where expected find true location - type: findInTree path: my-workflow.yml - # tree: "%actions.isInTree.data.tree%" - tree: "%registration.store.firstWorkflowTree%" - # action_id: fileLocation - store: - firstFileLocation: "%result.data.path%" + tree: "%actions.isInTree.data.tree%" + action_id: fileLocation # help user with proper file location - type: respond with: e-wrong-file-location.md data: - # haveFile: "%actions.fileLocation.path%" - haveFile: "%registration.store.firstFileLocation%" + haveFile: "%actions.fileLocation.path%" needFile: ".github/workflows/my-workflow.yml" editLink: "%payload.repository.html_url%/edit/%payload.pull_request.head.ref%/%actions.fileLocation.path%" fileName: my-workflow.yml @@ -103,7 +96,7 @@ steps: firstPullUrl: "%result.data.html_url%" firstPullNumber: "%result.data.number%" data: - actionsUrl: "%payload.repository.html_url%/actions" + actionsUrl: "%payload.repository.html_url%/actions%" - title: Merge the new workflow into the master branch description: Make the workflow available for use on the repository @@ -113,7 +106,6 @@ steps: - type: createIssue title: Create an issue comment with GitHub Script body: 02_workflow-triggered.md - # action_id: triggerIssue store: secondIssueNumber: "%result.data.number%" secondIssueUrl: "%result.data.html_url%" diff --git a/responses/00_welcome-activity.md b/responses/00_welcome-activity.md index 7227dd3..8f353c9 100644 --- a/responses/00_welcome-activity.md +++ b/responses/00_welcome-activity.md @@ -62,4 +62,4 @@ _It is important to place meaningful content into the body of the pull requests --- -I'll respond in the new pull request when I detect it has been created. +I am waiting for you to create a new pull request before moving on. diff --git a/responses/01_merge-workflow.md b/responses/01_merge-workflow.md index d2b2eaf..74a4850 100644 --- a/responses/01_merge-workflow.md +++ b/responses/01_merge-workflow.md @@ -8,12 +8,12 @@ Let's go ahead and do this now. ### :keyboard: Activity: Merge the workflow -When you are ready, merge this pull request. +1. Merge this pull request. --- -Once you have merged this pull request I will open a new issue so we can see this workflow in action! +I am waiting for you to merge this pull request before moving on. -Oh, I'll also be responding to you from that issue! +Once you have merged this pull request I will open a new issue so we can see this workflow in action!
Trouble merging?Try refreshing the page!
diff --git a/responses/03_add-to-projects.md b/responses/03_add-to-projects.md index 20d1223..66cead0 100644 --- a/responses/03_add-to-projects.md +++ b/responses/03_add-to-projects.md @@ -50,4 +50,6 @@ We've gone ahead and done this on our end of things so that we could give you th --- +I am waiting for you to create a new pull request before moving on. + I'll respond in the new pull request when I detect it has been created. diff --git a/responses/04_merge-workflow.md b/responses/04_merge-workflow.md index d097a58..14c421d 100644 --- a/responses/04_merge-workflow.md +++ b/responses/04_merge-workflow.md @@ -14,6 +14,8 @@ When you are ready, merge this pull request. --- +I am waiting for you to merge this pull request before moving on. + Once you have merged this pull request I will open a new issue so we can see this workflow in action!
Trouble merging?Try refreshing the page!
diff --git a/responses/06_steps-activity.md b/responses/06_steps-activity.md index 191068f..ef7c045 100644 --- a/responses/06_steps-activity.md +++ b/responses/06_steps-activity.md @@ -52,4 +52,6 @@ We will make the following changes to the current workflow file: --- +I am waiting for you to create a new pull request before moving on. + I'll respond in the pull request you create diff --git a/responses/07_use-fs.md b/responses/07_use-fs.md index 79ff44e..e9188b5 100644 --- a/responses/07_use-fs.md +++ b/responses/07_use-fs.md @@ -55,4 +55,6 @@ We will make the following changes to the current workflow file: --- +I am waiting for you to commit the desired changes to this branch before moving on. + I'll respond once you've committed the changes to this branch diff --git a/responses/08_merge-workflow.md b/responses/08_merge-workflow.md index de5f66d..da1b423 100644 --- a/responses/08_merge-workflow.md +++ b/responses/08_merge-workflow.md @@ -8,6 +8,8 @@ When you are ready, merge this pull request. --- +I am waiting for you to merge this pull request before moving on. + Once you have merged this pull request I will open a new issue so we can see this workflow in action!
Trouble merging?Try refreshing the page!
diff --git a/responses/09_issue-activity.md b/responses/09_issue-activity.md index 07e4b8c..20874e3 100644 --- a/responses/09_issue-activity.md +++ b/responses/09_issue-activity.md @@ -8,4 +8,6 @@ --- +I am waiting for you to open a new issue before moving on. + I'll respond in your new issue once you've opened it diff --git a/server-installation-notes.md b/server-installation-notes.md new file mode 100644 index 0000000..ced1ca8 --- /dev/null +++ b/server-installation-notes.md @@ -0,0 +1,24 @@ +## GitHub Enterprise Server (GHES) installation notes + + + +| 🚫 | This course needs features not yet supported by GHES. | +| --- | ----------------------------------------------------- | + + +This course makes use of [GitHub Actions](https://github.com/features/actions), a feature that is currently available for GitHub.com but not available on GHES. + + + +### Course dependencies + +The following are dependencies of the course. The course may continue to work without these dependencies, but learners won't experience the course as designed. + + + +| Dependency | Required? | Reason | Alternative | +| -------------------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| GHES must be able to reach githubusercontent.com | Yes | Images used throughout the course are served from this domain. Learners will find broken images required to take the course without this access. | Manually download the images referenced in the `responses/` folder, upload them to an accessible domain, and replace the images in the `responses/` folder. | +| Learner must be able to reach github.com and outside web | Yes | Links are provided to resources that live on the outside web. | Without access to resources on the outside web, learners will reach blocked resources. You can change the links to these resources in the `responses/` folder, and in the template repository. | + +| From 303974eda8b168c13722398f2dab0bf66620e0db Mon Sep 17 00:00:00 2001 From: mattdavis0351 Date: Thu, 26 Mar 2020 12:19:01 -0700 Subject: [PATCH 18/43] update config --- config.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/config.yml b/config.yml index 2b45f26..141473e 100644 --- a/config.yml +++ b/config.yml @@ -34,7 +34,7 @@ before: - 00_welcome-activity.md steps: - - title: Setup a workflow file + - title: Start here! description: Create a pull request to add a workflow event: - pull_request.opened @@ -42,6 +42,9 @@ steps: link: "{{store.welcomeIssueUrl}}" actions: - type: gate + store: + firstPullNumber: "%payload.pull_request.number%" + firstPullUrl: "%payload.pull_reqeust.html_url%" left: "%payload.pull_request.title%" operator: === right: Create my-workflow.yml @@ -92,14 +95,14 @@ steps: - type: createReview body: 01_merge-workflow.md event: APPROVE - store: - firstPullUrl: "%result.data.html_url%" - firstPullNumber: "%result.data.number%" + # store: + # firstPullUrl: "%result.data.html_url%" + # firstPullNumber: "%result.data.number%" data: actionsUrl: "%payload.repository.html_url%/actions%" - - title: Merge the new workflow into the master branch - description: Make the workflow available for use on the repository + - title: Add a workflow file to the repository + description: Merge the pull request containing the workflow into the master branch event: pull_request.closed link: "{{store.firstPullUrl}}" actions: From a295b6ae3835b5bce90504198efc4ae2340ac6fa Mon Sep 17 00:00:00 2001 From: mattdavis0351 Date: Thu, 26 Mar 2020 12:21:28 -0700 Subject: [PATCH 19/43] fix typo --- config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.yml b/config.yml index 141473e..04244a1 100644 --- a/config.yml +++ b/config.yml @@ -44,7 +44,7 @@ steps: - type: gate store: firstPullNumber: "%payload.pull_request.number%" - firstPullUrl: "%payload.pull_reqeust.html_url%" + firstPullUrl: "%payload.pull_requestt.html_url%" left: "%payload.pull_request.title%" operator: === right: Create my-workflow.yml From 493a894f4676aab1e471b23215a9f70f14194b0b Mon Sep 17 00:00:00 2001 From: mattdavis0351 Date: Thu, 26 Mar 2020 12:24:05 -0700 Subject: [PATCH 20/43] fix typo --- config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.yml b/config.yml index 04244a1..6da5756 100644 --- a/config.yml +++ b/config.yml @@ -44,7 +44,7 @@ steps: - type: gate store: firstPullNumber: "%payload.pull_request.number%" - firstPullUrl: "%payload.pull_requestt.html_url%" + firstPullUrl: "%payload.pull_request.html_url%" left: "%payload.pull_request.title%" operator: === right: Create my-workflow.yml From 4d306332d1c08af31a1363c208b99533fc588fe5 Mon Sep 17 00:00:00 2001 From: mattdavis0351 Date: Thu, 26 Mar 2020 12:38:08 -0700 Subject: [PATCH 21/43] checking new event trigger --- config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config.yml b/config.yml index 6da5756..0f2d799 100644 --- a/config.yml +++ b/config.yml @@ -101,8 +101,8 @@ steps: data: actionsUrl: "%payload.repository.html_url%/actions%" - - title: Add a workflow file to the repository - description: Merge the pull request containing the workflow into the master branch + - title: Merge the Create my-workflow.yml pull request + description: Make the workflow available to the repository by merging the pull request event: pull_request.closed link: "{{store.firstPullUrl}}" actions: @@ -116,7 +116,7 @@ steps: with: new-issue.md issue: "%registration.store.firstPullNumber%" data: - issueURL: "%registration.store.firstPullUrl%" + issueURL: "%registration.store.secondIssueNumber%" - title: Add another GitHub Script action description: Use GitHub Script to place this issue into a project board @@ -125,9 +125,9 @@ steps: link: "{{store.secondIssueUrl}}" actions: - type: gate - left: "%payload.check_suite.app.name%" + left: "%payload.comment.user.login%" operator: === - right: "GitHub Actions" + right: "github-actions[bot]" else: - type: respond issue: "%registration.store.secondIssueNumber%" From 19c3ac55ce36c6bcc868be06a529ba78e35fae67 Mon Sep 17 00:00:00 2001 From: mattdavis0351 Date: Thu, 26 Mar 2020 13:02:46 -0700 Subject: [PATCH 22/43] another workflow test --- config.yml | 49 +++++++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/config.yml b/config.yml index 0f2d799..5ec575a 100644 --- a/config.yml +++ b/config.yml @@ -42,21 +42,21 @@ steps: link: "{{store.welcomeIssueUrl}}" actions: - type: gate + left: "%payload.pull_request.title%" store: firstPullNumber: "%payload.pull_request.number%" firstPullUrl: "%payload.pull_request.html_url%" - left: "%payload.pull_request.title%" - operator: === - right: Create my-workflow.yml - # if those statments FAIL... do this - else: - - type: respond - with: e-rename-pr.md - data: - title: Create my-workflow.yml - # if those gates === true Then do this stuff + # operator: === + # right: Create my-workflow.yml + # # if those statments FAIL... do this + # else: + # - type: respond + # with: e-rename-pr.md + # data: + # title: Create my-workflow.yml + # if those gates === true Then do this stuff ####################################################### # Validate the filepath for the my-workflow.yml file # get tree @@ -89,7 +89,7 @@ steps: issue: "%registration.store.welcomeIssueNumber%" with: new-pull-request.md data: - pullUrl: "%payload.pull_request.html_url%" + pullUrl: "%registration.store.firstPullUrl%" - type: closeIssue issue: "%registration.store.welcomeIssueNumber%" - type: createReview @@ -101,7 +101,7 @@ steps: data: actionsUrl: "%payload.repository.html_url%/actions%" - - title: Merge the Create my-workflow.yml pull request + - title: Merge your first pull request description: Make the workflow available to the repository by merging the pull request event: pull_request.closed link: "{{store.firstPullUrl}}" @@ -116,7 +116,7 @@ steps: with: new-issue.md issue: "%registration.store.firstPullNumber%" data: - issueURL: "%registration.store.secondIssueNumber%" + issueURL: "%registration.store.secondIssueUrl%" - title: Add another GitHub Script action description: Use GitHub Script to place this issue into a project board @@ -167,6 +167,9 @@ steps: link: "{{ store.secondIssueUrl }}" actions: - type: gate + store: + secondPullNumber: "%result.data.number%" + secondPullUrl: "%result.data.html_url%" left: "%payload.pull_request.title%" operator: === right: Update my-workflow.yml @@ -212,19 +215,19 @@ steps: issue: "%registration.store.secondIssueNumber%" with: new-pull-request.md data: - pullUrl: "%payload.pull_request.html_url%" + pullUrl: "%registration.store.secondPullUrl%" - type: closeIssue issue: "%registration.store.secondIssueNumber%" - type: createReview body: 04_merge-workflow.md event: APPROVE - store: - secondPullNumber: "%result.data.number%" - secondPullUrl: "%result.data.html_url%" + # store: + # secondPullNumber: "%result.data.number%" + # secondPullUrl: "%result.data.html_url%" data: actionsUrl: "%payload.repository.html_url%/actions" - - title: Merge the new workflow into the master branch + - title: Merge the updated workflow into the master branch description: Make the workflow available for use on the repository event: pull_request.closed link: "{{ store.secondPullUrl }}" @@ -249,12 +252,12 @@ steps: link: "{{store.thirdIssueUrl}}" actions: - type: gate - left: "%payload.check_suite.app.name%" + left: "%payload.comment.user.login%" operator: === - right: "GitHub Actions" + right: "github-actions[bot]" else: - type: respond - issue: "%registration.store.thirdIssueNumber%" + issue: "%registration.store.secondIssueNumber%" with: debug.md data: debug: "%payload%" @@ -284,7 +287,9 @@ steps: - title: Create better comments description: Use a templated repsonse as the comment body - event: pull_request + event: + - pull_request.opened + - pull_request.edited link: "{{repoUrl}}/pull/6" actions: - type: octokit From 1899c9073039ff12642659c139f61d7dd7c6529e Mon Sep 17 00:00:00 2001 From: mattdavis0351 Date: Thu, 26 Mar 2020 13:48:10 -0700 Subject: [PATCH 23/43] add more dynamic values to config --- config.yml | 67 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 24 deletions(-) diff --git a/config.yml b/config.yml index 5ec575a..601ea67 100644 --- a/config.yml +++ b/config.yml @@ -46,17 +46,16 @@ steps: store: firstPullNumber: "%payload.pull_request.number%" firstPullUrl: "%payload.pull_request.html_url%" + operator: === + right: Create my-workflow.yml - # operator: === - # right: Create my-workflow.yml - - # # if those statments FAIL... do this - # else: - # - type: respond - # with: e-rename-pr.md - # data: - # title: Create my-workflow.yml - # if those gates === true Then do this stuff + # if those statments FAIL... do this + else: + - type: respond + with: e-rename-pr.md + data: + title: Create my-workflow.yml + if those gates === true Then do this stuff ####################################################### # Validate the filepath for the my-workflow.yml file # get tree @@ -168,10 +167,11 @@ steps: actions: - type: gate store: - secondPullNumber: "%result.data.number%" - secondPullUrl: "%result.data.html_url%" + secondPullNumber: "%payload.pull_request.number%" + secondPullUrl: "%payload.pull_request.html_url%" left: "%payload.pull_request.title%" operator: === + right: Update my-workflow.yml # if those statments FAIL... do this @@ -180,8 +180,7 @@ steps: with: e-rename-pr.md data: title: Update my-workflow.yml - # if those gates === true Then do this stuff - + # if those gates === true Then do this stuff ####################################################### # Validate the filepath for the my-workflow.yml file # get tree @@ -290,8 +289,13 @@ steps: event: - pull_request.opened - pull_request.edited - link: "{{repoUrl}}/pull/6" + link: "{{store.thirdIssueUrl}}" actions: + - type: gate + store: + thirdPullNumber: "%payload.pull_request.number%" + thirdPullUrl: "%payload.pull_request.html_url%" + left: "%payload.pull_request.title%" - type: octokit method: projects.listForRepo owner: "%payload.repository.owner.login%" @@ -305,7 +309,7 @@ steps: issue: "%registration.store.thirdIssueNumber%" with: new-pull-request.md data: - pullUrl: "%payload.pull_request.html_url%" + pullUrl: "%registration.store.thirdPullUrl%" - type: closeIssue issue: "%registration.store.thirdIssueNumber%" - type: respond @@ -319,7 +323,7 @@ steps: - title: Merge the final workflow description: Merge the final workflow into the repository event: pull_request.synchronize - link: "{{repoUrl}}/pull/6" + link: "{{store.thirdPullUrl}}" actions: - type: createReview body: 08_merge-workflow.md @@ -328,7 +332,7 @@ steps: - title: See workflow results description: See the results of the final workflow run event: pull_request.closed - link: "{{repoUrl}}/issue/7" + link: "{{store.thirdPullUrl}}" actions: - type: octokit action_id: triggerIssue @@ -345,24 +349,39 @@ steps: I'll respond here once it has completed! labels: ["bug"] + store: + fourthIssueUrl: "%result.data.html_url%" + fourthIssueNumber: "%result.data.number%" - type: respond with: new-issue.md - issue: 6 + issue: "%registration.store.thirdPullNumber%" data: - issueURL: "%actions.triggerIssue.data.html_url%" + # issueURL: "%actions.triggerIssue.data.html_url%" + issueURL: "%registration.store.fourthIssueUrl%" - title: Open an issue description: Open another issue that does not contain the bug tag - event: check_suite.completed - link: "{{repoUrl}}/issue/7" + # event: check_suite.completed + event: issue_comment.created + link: "{{store.fourthIssueUrl}}" actions: + - type: gate + left: "%payload.comment.user.login%" + operator: === + right: "github-actions[bot]" + else: + - type: respond + issue: "%registration.store.fourthIssueNumber%" + with: debug.md + data: + debug: "%payload%" - type: respond with: 09_workflow-completed.md - issue: 7 + issue: "%registration.store.fourthIssueNumber%" - type: respond with: 09_issue-activity.md - issue: 7 + issue: "%registration.store.fourthIssueNumber%" data: quicklink: "%payload.repository.html_url%/issues/new" From 94bacbc169647f89dc9b289dcf30625f1e48dc3c Mon Sep 17 00:00:00 2001 From: mattdavis0351 Date: Thu, 26 Mar 2020 13:50:28 -0700 Subject: [PATCH 24/43] fix typo --- config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.yml b/config.yml index 601ea67..55f44ba 100644 --- a/config.yml +++ b/config.yml @@ -55,7 +55,7 @@ steps: with: e-rename-pr.md data: title: Create my-workflow.yml - if those gates === true Then do this stuff + # if those gates === true Then do this stuff ####################################################### # Validate the filepath for the my-workflow.yml file # get tree From 96ef12b816c05b9672ee79237d3e8dff9f022dc0 Mon Sep 17 00:00:00 2001 From: mattdavis0351 Date: Thu, 26 Mar 2020 14:00:10 -0700 Subject: [PATCH 25/43] remove store from octokit call --- config.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/config.yml b/config.yml index 55f44ba..326ce88 100644 --- a/config.yml +++ b/config.yml @@ -140,13 +140,11 @@ steps: method: projects.listForRepo owner: "%payload.repository.owner.login%" repo: "%payload.repository.name%" - # action_id: projectBoard - store: - projectBoard: "%result.data.0.id%" + action_id: projectBoard + - type: octokit method: projects.listColumns - # project_id: "%actions.projectBoard.data.0.id%" - project_id: "%registration.store.projectBoard%" + project_id: "%actions.projectBoard.data.0.id%" action_id: listColumns store: listColumns: "%result.data.0.id" @@ -154,8 +152,7 @@ steps: with: 03_add-to-projects.md issue: "%registration.store.secondIssueNumber%" data: - # columnID: "%actions.listColumns.data.0.id%" - columnID: "%registration.store.listColumns%" + columnID: "%actions.listColumns.data.0.id%" quicklink: "%payload.repository.html_url%/edit/master/.github/workflows/my-workflow.yml" # new pull request - title: Modify your workflow file @@ -232,7 +229,7 @@ steps: link: "{{ store.secondPullUrl }}" actions: - type: createIssue - title: Create an issue comment with GitHub Script + title: Comment and triage with GitHub Script body: 05_workflow-triggered.md action_id: triggerIssue store: From e8257f03aaa2056380c9cd839e8bba2092f710e8 Mon Sep 17 00:00:00 2001 From: mattdavis0351 Date: Thu, 26 Mar 2020 14:16:57 -0700 Subject: [PATCH 26/43] fix course link numbers --- config.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/config.yml b/config.yml index 326ce88..2624dda 100644 --- a/config.yml +++ b/config.yml @@ -286,7 +286,7 @@ steps: event: - pull_request.opened - pull_request.edited - link: "{{store.thirdIssueUrl}}" + link: "{{store.thirdPullUrl}}" actions: - type: gate store: @@ -317,8 +317,8 @@ steps: columnID: "%actions.listColumns.data.0.id%" quicklink: "%payload.repository.html_url%/edit/%payload.pull_request.head.ref%/.github/workflows/my-workflow.yml" - - title: Merge the final workflow - description: Merge the final workflow into the repository + - title: Use a templated response + description: Create the comment body from a template using the Node.js file system module event: pull_request.synchronize link: "{{store.thirdPullUrl}}" actions: @@ -326,8 +326,8 @@ steps: body: 08_merge-workflow.md event: APPROVE - - title: See workflow results - description: See the results of the final workflow run + - title: Merge the updated workflow + description: Merge the worklow to the master branch event: pull_request.closed link: "{{store.thirdPullUrl}}" actions: @@ -357,8 +357,8 @@ steps: # issueURL: "%actions.triggerIssue.data.html_url%" issueURL: "%registration.store.fourthIssueUrl%" - - title: Open an issue - description: Open another issue that does not contain the bug tag + - title: Another workflow run + description: Observe the results of an enhanced workflow run # event: check_suite.completed event: issue_comment.created link: "{{store.fourthIssueUrl}}" From 28f2a412801d70cd0fc886077342b0a9c3e415d6 Mon Sep 17 00:00:00 2001 From: mattdavis0351 Date: Thu, 26 Mar 2020 14:29:26 -0700 Subject: [PATCH 27/43] changing event triggers --- config.yml | 28 +++++++++++++++++++--------- responses/e-action-result.md | 3 +++ 2 files changed, 22 insertions(+), 9 deletions(-) create mode 100644 responses/e-action-result.md diff --git a/config.yml b/config.yml index 2624dda..8af5363 100644 --- a/config.yml +++ b/config.yml @@ -293,6 +293,14 @@ steps: thirdPullNumber: "%payload.pull_request.number%" thirdPullUrl: "%payload.pull_request.html_url%" left: "%payload.pull_request.title%" + operator: === + right: Update my-workflow.yml + # if those statments FAIL... do this + else: + - type: respond + with: e-rename-pr.md + data: + title: Update my-workflow.yml - type: octokit method: projects.listForRepo owner: "%payload.repository.owner.login%" @@ -354,25 +362,20 @@ steps: with: new-issue.md issue: "%registration.store.thirdPullNumber%" data: - # issueURL: "%actions.triggerIssue.data.html_url%" issueURL: "%registration.store.fourthIssueUrl%" - title: Another workflow run description: Observe the results of an enhanced workflow run - # event: check_suite.completed - event: issue_comment.created + event: check_suite.completed link: "{{store.fourthIssueUrl}}" actions: - type: gate - left: "%payload.comment.user.login%" + left: "%payload.check_suite.app.name%" operator: === - right: "github-actions[bot]" + right: "GitHub Actions" else: - type: respond - issue: "%registration.store.fourthIssueNumber%" - with: debug.md - data: - debug: "%payload%" + with: e-action-result.md - type: respond with: 09_workflow-completed.md issue: "%registration.store.fourthIssueNumber%" @@ -387,6 +390,13 @@ steps: event: check_suite.completed link: "{{repoUrl}}/issue/8" actions: + - type: gate + left: "%payload.check_suite.app.name%" + operator: === + right: "GitHub Actions" + else: + - type: respond + with: e-action-result.md - type: respond with: 10_workflow-completed.md issue: 8 diff --git a/responses/e-action-result.md b/responses/e-action-result.md new file mode 100644 index 0000000..4745e34 --- /dev/null +++ b/responses/e-action-result.md @@ -0,0 +1,3 @@ +# Oops! + +It seems like there is an issue with your workflow run. You'll need to head to the actions tab to troubleshoot your workflow From 398efe3e3a50f8cb4127c6965b16b26e199af786 Mon Sep 17 00:00:00 2001 From: Hector Alfaro Date: Mon, 30 Mar 2020 11:43:28 -0400 Subject: [PATCH 28/43] fix typo --- responses/00_welcome-activity.md | 2 +- responses/02_workflow-triggered.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/responses/00_welcome-activity.md b/responses/00_welcome-activity.md index 8f353c9..0170ffc 100644 --- a/responses/00_welcome-activity.md +++ b/responses/00_welcome-activity.md @@ -20,7 +20,7 @@ Your repository can contain multiple **workflow** files that carry out a wide va 📖 Read more about [workflows](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/configuring-a-workflow#choosing-the-type-of-actions-for-your-workflow) -### :keyboard: Activity: Respond to an issue when it get's opened +### :keyboard: Activity: Respond to an issue when it gets opened 1. Create a new workflow file titled `.github/workflows/my-workflow.yml` with the following contents: You can use [this quicklink]({{quicklink}}) to easily create this file diff --git a/responses/02_workflow-triggered.md b/responses/02_workflow-triggered.md index 910e212..b523e6f 100644 --- a/responses/02_workflow-triggered.md +++ b/responses/02_workflow-triggered.md @@ -10,7 +10,7 @@ on: types: [opened] ``` -This means that every time an issue get's opened in this repository the GitHub Script you wrote will execute. +This means that every time an issue gets opened in this repository the GitHub Script you wrote will execute. You should expect to see the result right here in this issue! From 5948e155b4aadbd18f8f1adda2a987cfcff093d3 Mon Sep 17 00:00:00 2001 From: Hector Alfaro Date: Mon, 30 Mar 2020 11:51:34 -0400 Subject: [PATCH 29/43] link to the created project board --- config.yml | 2 ++ responses/03_add-to-projects.md | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config.yml b/config.yml index 8af5363..847332d 100644 --- a/config.yml +++ b/config.yml @@ -19,6 +19,8 @@ before: columns: - Triage Backlog - Triage Complete + store: + projectUrl: '{{ result.data.html_url }}' - type: createIssue title: Start here! body: 00_welcome-issue.md diff --git a/responses/03_add-to-projects.md b/responses/03_add-to-projects.md index 66cead0..d8f72af 100644 --- a/responses/03_add-to-projects.md +++ b/responses/03_add-to-projects.md @@ -1,6 +1,6 @@ # Let's add a card to a project board -We have added a project board to this repository for you. We will use this board, named **Learning Lab Project Board**, to add cards to when a new issue is created in your repository! +We have added [a project board]({{ store.projectUrl }}) to this repository for you. We will use this board, named **Learning Lab Project Board**, to add cards to when a new issue is created in your repository! Like creating comments and opening pull requests, octokit/rest.js can be used for many more types of interactions. Managing GitHub Projects makes that list! From 129c467b4542ff676412ad8670a71fa2bcc74b3f Mon Sep 17 00:00:00 2001 From: Hector Alfaro Date: Mon, 30 Mar 2020 12:09:12 -0400 Subject: [PATCH 30/43] fix some typos --- responses/04_merge-workflow.md | 2 +- responses/06_steps-activity.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/responses/04_merge-workflow.md b/responses/04_merge-workflow.md index 14c421d..5f44b71 100644 --- a/responses/04_merge-workflow.md +++ b/responses/04_merge-workflow.md @@ -2,7 +2,7 @@ @{{user.login}}, you're a rockstar ✨ -You'r workflow now has the necessary updates for us to have new issues automatically added to the triage board when they are created! +Your workflow now has the necessary updates for us to have new issues automatically added to the triage board when they are created! Like before, this workflow has a trigger that pertains to the repository as a whole, rather than just this branch, we will need to merge this pull request before we can start using it. diff --git a/responses/06_steps-activity.md b/responses/06_steps-activity.md index ef7c045..915a91c 100644 --- a/responses/06_steps-activity.md +++ b/responses/06_steps-activity.md @@ -2,12 +2,12 @@ We will make the following changes to the current workflow file: -- Name each step so we can easily keep track of it in the [actions tab]({{actionTab}}) +- Name each step so we can easily keep track of it in the [actions tab]({{actionsTab}}) - Use expressions to determine `if` a step should execute ### :keyboard: Activity: Add newly opened issue to project board -1. [Edit]({{quicklink}}) the current workflow `.github/workflows/my-workflow.yml` to have he following contents: +1. [Edit]({{quicklink}}) the current workflow `.github/workflows/my-workflow.yml` to have the following contents: ```yaml name: Learning GitHub Script From 413f99e31254c1dab3cb064b0f6d46227391b466 Mon Sep 17 00:00:00 2001 From: mattdavis0351 Date: Mon, 30 Mar 2020 10:37:27 -0700 Subject: [PATCH 31/43] use store instead of action_id --- config.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/config.yml b/config.yml index 8af5363..6de2334 100644 --- a/config.yml +++ b/config.yml @@ -141,18 +141,22 @@ steps: owner: "%payload.repository.owner.login%" repo: "%payload.repository.name%" action_id: projectBoard + store: + boardID: "%result.data.0.id%" - type: octokit method: projects.listColumns - project_id: "%actions.projectBoard.data.0.id%" + # project_id: "%actions.projectBoard.data.0.id%" + project_id: "%registration.store.boardID%" action_id: listColumns store: - listColumns: "%result.data.0.id" + columnID: "%result.data.0.id%" - type: respond with: 03_add-to-projects.md issue: "%registration.store.secondIssueNumber%" data: - columnID: "%actions.listColumns.data.0.id%" + # columnID: "%actions.listColumns.data.0.id%" + columnID: "%registration.store.columnID%" quicklink: "%payload.repository.html_url%/edit/master/.github/workflows/my-workflow.yml" # new pull request - title: Modify your workflow file From 947f38b0f835df0e4075c0b5c73243f4b10c5709 Mon Sep 17 00:00:00 2001 From: mattdavis0351 Date: Mon, 30 Mar 2020 10:47:50 -0700 Subject: [PATCH 32/43] remove old action_id references, store works here --- config.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/config.yml b/config.yml index 0d6f7d4..265f3ec 100644 --- a/config.yml +++ b/config.yml @@ -19,8 +19,8 @@ before: columns: - Triage Backlog - Triage Complete - store: - projectUrl: '{{ result.data.html_url }}' + store: + projectUrl: "{{ result.data.html_url }}" - type: createIssue title: Start here! body: 00_welcome-issue.md @@ -142,22 +142,17 @@ steps: method: projects.listForRepo owner: "%payload.repository.owner.login%" repo: "%payload.repository.name%" - action_id: projectBoard store: boardID: "%result.data.0.id%" - - type: octokit method: projects.listColumns - # project_id: "%actions.projectBoard.data.0.id%" project_id: "%registration.store.boardID%" - action_id: listColumns store: columnID: "%result.data.0.id%" - type: respond with: 03_add-to-projects.md issue: "%registration.store.secondIssueNumber%" data: - # columnID: "%actions.listColumns.data.0.id%" columnID: "%registration.store.columnID%" quicklink: "%payload.repository.html_url%/edit/master/.github/workflows/my-workflow.yml" # new pull request From 45536e7e71b65e59e74b6f50cfbf519498d65859 Mon Sep 17 00:00:00 2001 From: mattdavis0351 Date: Mon, 30 Mar 2020 15:04:35 -0700 Subject: [PATCH 33/43] use better pull naming --- config.yml | 19 ++++++------------- responses/00_welcome-activity.md | 2 +- responses/03_add-to-projects.md | 2 +- responses/06_steps-activity.md | 2 +- 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/config.yml b/config.yml index 265f3ec..1aec3c6 100644 --- a/config.yml +++ b/config.yml @@ -49,14 +49,14 @@ steps: firstPullNumber: "%payload.pull_request.number%" firstPullUrl: "%payload.pull_request.html_url%" operator: === - right: Create my-workflow.yml + right: Automate issue responses # if those statments FAIL... do this else: - type: respond with: e-rename-pr.md data: - title: Create my-workflow.yml + title: Automate issue responses # if those gates === true Then do this stuff ####################################################### # Validate the filepath for the my-workflow.yml file @@ -96,9 +96,6 @@ steps: - type: createReview body: 01_merge-workflow.md event: APPROVE - # store: - # firstPullUrl: "%result.data.html_url%" - # firstPullNumber: "%result.data.number%" data: actionsUrl: "%payload.repository.html_url%/actions%" @@ -170,14 +167,14 @@ steps: left: "%payload.pull_request.title%" operator: === - right: Update my-workflow.yml + right: Add issues to project board # if those statments FAIL... do this else: - type: respond with: e-rename-pr.md data: - title: Update my-workflow.yml + title: Add issues to project board # if those gates === true Then do this stuff ####################################################### # Validate the filepath for the my-workflow.yml file @@ -218,9 +215,6 @@ steps: - type: createReview body: 04_merge-workflow.md event: APPROVE - # store: - # secondPullNumber: "%result.data.number%" - # secondPullUrl: "%result.data.html_url%" data: actionsUrl: "%payload.repository.html_url%/actions" @@ -244,7 +238,6 @@ steps: - title: Break your workflow into multiple steps description: Separate the workflow concerns by adding more steps - # event: check_suite.completed event: issue_comment.created link: "{{store.thirdIssueUrl}}" actions: @@ -295,13 +288,13 @@ steps: thirdPullUrl: "%payload.pull_request.html_url%" left: "%payload.pull_request.title%" operator: === - right: Update my-workflow.yml + right: Create better comments # if those statments FAIL... do this else: - type: respond with: e-rename-pr.md data: - title: Update my-workflow.yml + title: Create better comments - type: octokit method: projects.listForRepo owner: "%payload.repository.owner.login%" diff --git a/responses/00_welcome-activity.md b/responses/00_welcome-activity.md index 0170ffc..603942b 100644 --- a/responses/00_welcome-activity.md +++ b/responses/00_welcome-activity.md @@ -49,7 +49,7 @@ Your repository can contain multiple **workflow** files that carry out a wide va ``` 1. Commit the workflow to a new branch. -1. Create a pull request titled **Create my-workflow.yml**. +1. Create a pull request titled **Automate issue responses**. 1. Supply the pull request body content and click `Create pull request`. _It is important to place meaningful content into the body of the pull requests you create throughout this course. This repository will stay with you long after you complete the course. It is advisable that you use the body of the pull requests you create as a way to take long lived notes about thing you want to remember._ diff --git a/responses/03_add-to-projects.md b/responses/03_add-to-projects.md index d8f72af..568aaf8 100644 --- a/responses/03_add-to-projects.md +++ b/responses/03_add-to-projects.md @@ -45,7 +45,7 @@ We've gone ahead and done this on our end of things so that we could give you th ``` 2. Commit the workflow to a new branch. -3. Create a pull request titled **Update my-workflow.yml**. +3. Create a pull request titled **Add issues to project board**. 4. Supply the pull request body content and click `Create pull request`. --- diff --git a/responses/06_steps-activity.md b/responses/06_steps-activity.md index 915a91c..5eb21ec 100644 --- a/responses/06_steps-activity.md +++ b/responses/06_steps-activity.md @@ -47,7 +47,7 @@ We will make the following changes to the current workflow file: ``` 2. Commit the workflow to a new branch. -3. Create a pull request titled **Update my-workflow.yml**. +3. Create a pull request titled **Create better comments**. 4. Supply the pull request body content and click `Create pull request`. --- From 6518b3175e218f01a4fce8132eb010b2c8bdea9f Mon Sep 17 00:00:00 2001 From: Hector Alfaro Date: Thu, 2 Apr 2020 19:41:07 -0400 Subject: [PATCH 34/43] add a tag --- config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/config.yml b/config.yml index 1aec3c6..7a47af2 100644 --- a/config.yml +++ b/config.yml @@ -7,6 +7,7 @@ tags: - Octokit - Workflow - Automation + - Application programming interface (API) template: repo: write-github-script-template name: write-github-script From 7ad50540d6b88d7319c4b805ed6e8bb7899c4eef Mon Sep 17 00:00:00 2001 From: Hector Alfaro Date: Thu, 2 Apr 2020 19:55:56 -0400 Subject: [PATCH 35/43] clean up the first step a bit --- config.yml | 40 ++++++++++++++++++-------------- responses/00_welcome-activity.md | 12 ++++++---- 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/config.yml b/config.yml index 7a47af2..fd1fba3 100644 --- a/config.yml +++ b/config.yml @@ -11,8 +11,24 @@ tags: template: repo: write-github-script-template name: write-github-script + +# Repo artifacts +# repositoryUrl +# 1. (Issue) Start here! +# welcomeIssueUrl +# welcomeIssueNumber +# 2. (PR) Learner created PR, "Automate issue response" possibly +# firstPullNumber +# firstPullUrl +# 3. (Issue) Create an issue comment with GitHub Script +# secondIssueNumber +# secondIssueUrl + before: - type: updateBranchProtection + store: + repositoryUrl: '{{ payload.repository.html_url }}' + actionsUrl: '{{ payload.repository.html_url }}/actions' - type: createProjectBoard name: Learning Lab Project Board description: >- @@ -29,8 +45,8 @@ before: welcomeIssueUrl: "%result.data.html_url%" welcomeIssueNumber: "%result.data.number%" data: - quicklink: "%payload.repository.html_url%/new/master?filename=.github/workflows/my-workflow.yml" - actionsUrl: "%payload.repository.html_url%/actions/new" + quicklink: "{{ store.repositoryUrl }}/new/master?filename=.github/workflows/my-workflow.yml" + actionsUrl: "{{ store.repositoryUrl }}/actions/new" comments: - 00_explain-gh-script.md - 00_octokit-comparison.md @@ -44,28 +60,16 @@ steps: - pull_request.edited link: "{{store.welcomeIssueUrl}}" actions: - - type: gate - left: "%payload.pull_request.title%" - store: - firstPullNumber: "%payload.pull_request.number%" - firstPullUrl: "%payload.pull_request.html_url%" - operator: === - right: Automate issue responses - - # if those statments FAIL... do this - else: - - type: respond - with: e-rename-pr.md - data: - title: Automate issue responses - # if those gates === true Then do this stuff - ####################################################### # Validate the filepath for the my-workflow.yml file # get tree - type: getTree action_id: isInTree recursive: true sha: "%payload.pull_request.head.sha%" + store: + firstPullNumber: "%payload.pull_request.number%" + firstPullUrl: "%payload.pull_request.html_url%" + # check for a file in a tree - type: gate left: "%actions.isInTree.data.tree%" diff --git a/responses/00_welcome-activity.md b/responses/00_welcome-activity.md index 603942b..984ee3d 100644 --- a/responses/00_welcome-activity.md +++ b/responses/00_welcome-activity.md @@ -49,14 +49,18 @@ Your repository can contain multiple **workflow** files that carry out a wide va ``` 1. Commit the workflow to a new branch. -1. Create a pull request titled **Automate issue responses**. +1. Create a pull request. I suggest a title like **Automate issue responses**. 1. Supply the pull request body content and click `Create pull request`. -_It is important to place meaningful content into the body of the pull requests you create throughout this course. This repository will stay with you long after you complete the course. It is advisable that you use the body of the pull requests you create as a way to take long lived notes about thing you want to remember._ +
About pull pull request titles and content -
Suggested body content +It is important to place meaningful content into the body of the pull requests you create. This repository will stay with you long after you complete the course. We recommend you use the body of your pull requests as a way to take long lived notes about thing you want to remember. -`Workflow files are the recipe for task automation. This is where actions are placed if I want to use them for a task.` +In practice, good pull request titles and content convey information efficiently to your collaborators. + +You can fill the body of this pull request with the following recommended content: + +> Workflow files are the recipe for task automation. This is where actions are placed if I want to use them for a task.
From 837455e17df295ca76a6a3adc5fcf8724b85d99e Mon Sep 17 00:00:00 2001 From: Hector Alfaro Date: Thu, 2 Apr 2020 19:56:04 -0400 Subject: [PATCH 36/43] validate learner's merging first PR --- config.yml | 14 ++++++++++++-- responses/e-generic.md | 3 +++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 responses/e-generic.md diff --git a/config.yml b/config.yml index fd1fba3..01a1fcf 100644 --- a/config.yml +++ b/config.yml @@ -101,14 +101,24 @@ steps: - type: createReview body: 01_merge-workflow.md event: APPROVE - data: - actionsUrl: "%payload.repository.html_url%/actions%" - title: Merge your first pull request description: Make the workflow available to the repository by merging the pull request event: pull_request.closed link: "{{store.firstPullUrl}}" actions: + - type: gate + every: true + gates: + - left: '{{ payload.pull_request.number }}' + operator: === + right: '{{ store.firstPullNumber }}' + - left: '{{ payload.pull_request.merged }}' + else: + - type: respond + with: e-generic.md + data: + expected: merge pull request '{{ store.firstPullNumber }}' - type: createIssue title: Create an issue comment with GitHub Script body: 02_workflow-triggered.md diff --git a/responses/e-generic.md b/responses/e-generic.md new file mode 100644 index 0000000..4d86027 --- /dev/null +++ b/responses/e-generic.md @@ -0,0 +1,3 @@ +Oops! I was expecting you to take **{{ expected }}**. + +I'll respond when you take the expected action. \ No newline at end of file From 4b4b15caf1861c475c5bf54120004d9551dd27f9 Mon Sep 17 00:00:00 2001 From: Hector Alfaro Date: Thu, 2 Apr 2020 20:05:28 -0400 Subject: [PATCH 37/43] clean up second step a bit --- config.yml | 26 ++++++++------------------ responses/00_welcome-activity.md | 2 +- responses/03_add-to-projects.md | 4 ++-- responses/new-issue.md | 2 +- 4 files changed, 12 insertions(+), 22 deletions(-) diff --git a/config.yml b/config.yml index 01a1fcf..c00eb14 100644 --- a/config.yml +++ b/config.yml @@ -23,6 +23,9 @@ template: # 3. (Issue) Create an issue comment with GitHub Script # secondIssueNumber # secondIssueUrl +# 4. (PR) Learner created PR, "Add issues to project board" possibly +# secondPullNumber +# secondPullUrl before: - type: updateBranchProtection @@ -95,7 +98,7 @@ steps: issue: "%registration.store.welcomeIssueNumber%" with: new-pull-request.md data: - pullUrl: "%registration.store.firstPullUrl%" + pullurl: '{{ store.firstPullUrl }}' - type: closeIssue issue: "%registration.store.welcomeIssueNumber%" - type: createReview @@ -129,7 +132,7 @@ steps: with: new-issue.md issue: "%registration.store.firstPullNumber%" data: - issueURL: "%registration.store.secondIssueUrl%" + issueUrl: '{{ store.secondIssueUrl }}' - title: Add another GitHub Script action description: Use GitHub Script to place this issue into a project board @@ -175,22 +178,6 @@ steps: - pull_request.edited link: "{{ store.secondIssueUrl }}" actions: - - type: gate - store: - secondPullNumber: "%payload.pull_request.number%" - secondPullUrl: "%payload.pull_request.html_url%" - left: "%payload.pull_request.title%" - operator: === - - right: Add issues to project board - - # if those statments FAIL... do this - else: - - type: respond - with: e-rename-pr.md - data: - title: Add issues to project board - # if those gates === true Then do this stuff ####################################################### # Validate the filepath for the my-workflow.yml file # get tree @@ -198,6 +185,9 @@ steps: action_id: isInTree recursive: true sha: "%payload.pull_request.head.sha%" + store: + secondPullNumber: "%payload.pull_request.number%" + secondPullUrl: "%payload.pull_request.html_url%" # check for a file in a tree - type: gate left: "%actions.isInTree.data.tree%" diff --git a/responses/00_welcome-activity.md b/responses/00_welcome-activity.md index 984ee3d..e595833 100644 --- a/responses/00_welcome-activity.md +++ b/responses/00_welcome-activity.md @@ -50,7 +50,7 @@ Your repository can contain multiple **workflow** files that carry out a wide va 1. Commit the workflow to a new branch. 1. Create a pull request. I suggest a title like **Automate issue responses**. -1. Supply the pull request body content and click `Create pull request`. +1. Supply the pull request body content and click **Create pull request**.
About pull pull request titles and content diff --git a/responses/03_add-to-projects.md b/responses/03_add-to-projects.md index 568aaf8..bf909d5 100644 --- a/responses/03_add-to-projects.md +++ b/responses/03_add-to-projects.md @@ -45,8 +45,8 @@ We've gone ahead and done this on our end of things so that we could give you th ``` 2. Commit the workflow to a new branch. -3. Create a pull request titled **Add issues to project board**. -4. Supply the pull request body content and click `Create pull request`. +3. Create a pull request, I suggest the title **Add issues to project board**. +4. Supply the pull request body content and click **Create pull request**. --- diff --git a/responses/new-issue.md b/responses/new-issue.md index 64fe506..2513b48 100644 --- a/responses/new-issue.md +++ b/responses/new-issue.md @@ -1,3 +1,3 @@ ## A new issue has been opened -I have created a [new issue]({{issueURL}}) where we will continue this lesson. Click the link to meet me over there. +I have created a [new issue]({{issueUrl}}) where we will continue this lesson. Click the link to meet me over there. From ec2622961e2a670964a745a7f072c56d6e7fc45d Mon Sep 17 00:00:00 2001 From: Hector Alfaro Date: Thu, 2 Apr 2020 21:00:39 -0400 Subject: [PATCH 38/43] s/registration.store/store --- config.yml | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/config.yml b/config.yml index c00eb14..559969e 100644 --- a/config.yml +++ b/config.yml @@ -95,12 +95,12 @@ steps: # End filepath verification ####################################################### - type: respond - issue: "%registration.store.welcomeIssueNumber%" + issue: "%store.welcomeIssueNumber%" with: new-pull-request.md data: pullurl: '{{ store.firstPullUrl }}' - type: closeIssue - issue: "%registration.store.welcomeIssueNumber%" + issue: "%store.welcomeIssueNumber%" - type: createReview body: 01_merge-workflow.md event: APPROVE @@ -130,7 +130,7 @@ steps: secondIssueUrl: "%result.data.html_url%" - type: respond with: new-issue.md - issue: "%registration.store.firstPullNumber%" + issue: "%store.firstPullNumber%" data: issueUrl: '{{ store.secondIssueUrl }}' @@ -146,13 +146,13 @@ steps: right: "github-actions[bot]" else: - type: respond - issue: "%registration.store.secondIssueNumber%" + issue: "%store.secondIssueNumber%" with: debug.md data: debug: "%payload%" - type: respond with: 03_workflow-success.md - issue: "%registration.store.secondIssueNumber%" + issue: "%store.secondIssueNumber%" - type: octokit method: projects.listForRepo owner: "%payload.repository.owner.login%" @@ -161,14 +161,14 @@ steps: boardID: "%result.data.0.id%" - type: octokit method: projects.listColumns - project_id: "%registration.store.boardID%" + project_id: "%store.boardID%" store: columnID: "%result.data.0.id%" - type: respond with: 03_add-to-projects.md - issue: "%registration.store.secondIssueNumber%" + issue: "%store.secondIssueNumber%" data: - columnID: "%registration.store.columnID%" + columnID: "%store.columnID%" quicklink: "%payload.repository.html_url%/edit/master/.github/workflows/my-workflow.yml" # new pull request - title: Modify your workflow file @@ -211,12 +211,12 @@ steps: # End filepath verification ####################################################### - type: respond - issue: "%registration.store.secondIssueNumber%" + issue: "%store.secondIssueNumber%" with: new-pull-request.md data: - pullUrl: "%registration.store.secondPullUrl%" + pullUrl: "%store.secondPullUrl%" - type: closeIssue - issue: "%registration.store.secondIssueNumber%" + issue: "%store.secondIssueNumber%" - type: createReview body: 04_merge-workflow.md event: APPROVE @@ -237,9 +237,9 @@ steps: thirdIssueNumber: "%result.data.number%" - type: respond with: new-issue.md - issue: "%registration.store.secondPullNumber%" + issue: "%store.secondPullNumber%" data: - issueURL: "%registration.store.thirdIssueUrl%" + issueURL: "%store.thirdIssueUrl%" - title: Break your workflow into multiple steps description: Separate the workflow concerns by adding more steps @@ -252,7 +252,7 @@ steps: right: "github-actions[bot]" else: - type: respond - issue: "%registration.store.secondIssueNumber%" + issue: "%store.secondIssueNumber%" with: debug.md data: debug: "%payload%" @@ -267,12 +267,12 @@ steps: action_id: listColumns - type: respond with: 06_steps-overview.md - issue: "%registration.store.thirdIssueNumber%" + issue: "%store.thirdIssueNumber%" data: projectTab: "%payload.repository.html_url%/projects/1" - type: respond with: 06_steps-activity.md - issue: "%registration.store.thirdIssueNumber%" + issue: "%store.thirdIssueNumber%" data: listProj: "%actions.projectBoard.data%" listCol: "%actions.listColumns.data%" @@ -310,12 +310,12 @@ steps: project_id: "%actions.projectBoard.data.0.id%" action_id: listColumns - type: respond - issue: "%registration.store.thirdIssueNumber%" + issue: "%store.thirdIssueNumber%" with: new-pull-request.md data: - pullUrl: "%registration.store.thirdPullUrl%" + pullUrl: "%store.thirdPullUrl%" - type: closeIssue - issue: "%registration.store.thirdIssueNumber%" + issue: "%store.thirdIssueNumber%" - type: respond with: 07_explain-node.md - type: respond @@ -359,9 +359,9 @@ steps: - type: respond with: new-issue.md - issue: "%registration.store.thirdPullNumber%" + issue: "%store.thirdPullNumber%" data: - issueURL: "%registration.store.fourthIssueUrl%" + issueURL: "%store.fourthIssueUrl%" - title: Another workflow run description: Observe the results of an enhanced workflow run @@ -377,10 +377,10 @@ steps: with: e-action-result.md - type: respond with: 09_workflow-completed.md - issue: "%registration.store.fourthIssueNumber%" + issue: "%store.fourthIssueNumber%" - type: respond with: 09_issue-activity.md - issue: "%registration.store.fourthIssueNumber%" + issue: "%store.fourthIssueNumber%" data: quicklink: "%payload.repository.html_url%/issues/new" From c719dcc4a12950ca4bffd3f7cf0a2d8e8d337543 Mon Sep 17 00:00:00 2001 From: Hector Alfaro Date: Thu, 2 Apr 2020 21:09:51 -0400 Subject: [PATCH 39/43] add remaining validations --- config.yml | 58 ++++++++++++++++++++++++++-------- responses/06_steps-activity.md | 4 +-- 2 files changed, 47 insertions(+), 15 deletions(-) diff --git a/config.yml b/config.yml index 559969e..3bac946 100644 --- a/config.yml +++ b/config.yml @@ -26,6 +26,15 @@ template: # 4. (PR) Learner created PR, "Add issues to project board" possibly # secondPullNumber # secondPullUrl +# 5. (Issue) Comment and triage with GitHub Script +# thirdIssueUrl +# thirdIssueNumber +# 6. (PR) Learner created PR, "Create better comments" possibly +# thirdPullNumber +# thirdPullUrl +# 7. (Issue) It's alive! +# fourthIssueUrl +# fourthIssueNumber before: - type: updateBranchProtection @@ -228,6 +237,18 @@ steps: event: pull_request.closed link: "{{ store.secondPullUrl }}" actions: + - type: gate + every: true + gates: + - left: '{{ payload.pull_request.number }}' + operator: === + right: '{{ store.secondPullNumber }}' + - left: '{{ payload.pull_request.merged }}' + else: + - type: respond + with: e-generic.md + data: + expected: merge pull request '{{ store.secondPullNumber }}' - type: createIssue title: Comment and triage with GitHub Script body: 05_workflow-triggered.md @@ -287,24 +308,14 @@ steps: - pull_request.edited link: "{{store.thirdPullUrl}}" actions: - - type: gate - store: - thirdPullNumber: "%payload.pull_request.number%" - thirdPullUrl: "%payload.pull_request.html_url%" - left: "%payload.pull_request.title%" - operator: === - right: Create better comments - # if those statments FAIL... do this - else: - - type: respond - with: e-rename-pr.md - data: - title: Create better comments - type: octokit method: projects.listForRepo owner: "%payload.repository.owner.login%" repo: "%payload.repository.name%" action_id: projectBoard + store: + thirdPullNumber: "%payload.pull_request.number%" + thirdPullUrl: "%payload.pull_request.html_url%" - type: octokit method: projects.listColumns project_id: "%actions.projectBoard.data.0.id%" @@ -329,6 +340,15 @@ steps: event: pull_request.synchronize link: "{{store.thirdPullUrl}}" actions: + - type: gate + left: '{{ payload.pull_request.number }}' + operator: === + right: '{{ store.thirdPullNumber }}' + else: + - type: respond + with: e-generic.md + data: + expected: push a commit to '{{ store.thirdPullNumber }}' - type: createReview body: 08_merge-workflow.md event: APPROVE @@ -338,6 +358,18 @@ steps: event: pull_request.closed link: "{{store.thirdPullUrl}}" actions: + - type: gate + every: true + gates: + - left: '{{ payload.pull_request.number }}' + operator: === + right: '{{ store.thirdPullNumber }}' + - left: '{{ payload.pull_request.merged }}' + else: + - type: respond + with: e-generic.md + data: + expected: merge pull request '{{ store.thirdPullNumber }}' - type: octokit action_id: triggerIssue method: issues.create diff --git a/responses/06_steps-activity.md b/responses/06_steps-activity.md index 5eb21ec..d01769e 100644 --- a/responses/06_steps-activity.md +++ b/responses/06_steps-activity.md @@ -47,8 +47,8 @@ We will make the following changes to the current workflow file: ``` 2. Commit the workflow to a new branch. -3. Create a pull request titled **Create better comments**. -4. Supply the pull request body content and click `Create pull request`. +3. Create a pull request, I suggest the title **Create better comments**. +4. Supply the pull request body content and click **Create pull request**. --- From 7be42b4f883f485300b7d2b9b0d6cec1a4ed12b4 Mon Sep 17 00:00:00 2001 From: Hector Alfaro Date: Thu, 2 Apr 2020 21:12:45 -0400 Subject: [PATCH 40/43] typo for pullUrl --- config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.yml b/config.yml index 3bac946..c153b73 100644 --- a/config.yml +++ b/config.yml @@ -107,7 +107,7 @@ steps: issue: "%store.welcomeIssueNumber%" with: new-pull-request.md data: - pullurl: '{{ store.firstPullUrl }}' + pullUrl: '{{ store.firstPullUrl }}' - type: closeIssue issue: "%store.welcomeIssueNumber%" - type: createReview From ead9d07f8ffa8c621977aec99fdbb456c88a7e46 Mon Sep 17 00:00:00 2001 From: Hector Alfaro Date: Thu, 2 Apr 2020 21:15:32 -0400 Subject: [PATCH 41/43] fix typo on issue link --- config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.yml b/config.yml index c153b73..b0e44a1 100644 --- a/config.yml +++ b/config.yml @@ -260,7 +260,7 @@ steps: with: new-issue.md issue: "%store.secondPullNumber%" data: - issueURL: "%store.thirdIssueUrl%" + issueUrl: "%store.thirdIssueUrl%" - title: Break your workflow into multiple steps description: Separate the workflow concerns by adding more steps @@ -393,7 +393,7 @@ steps: with: new-issue.md issue: "%store.thirdPullNumber%" data: - issueURL: "%store.fourthIssueUrl%" + issueUrl: "%store.fourthIssueUrl%" - title: Another workflow run description: Observe the results of an enhanced workflow run From fe4ea22c1157d6d87e9e8297a18d3e1d0e396f9d Mon Sep 17 00:00:00 2001 From: Hector Alfaro Date: Thu, 2 Apr 2020 21:19:26 -0400 Subject: [PATCH 42/43] use the store for the actions link --- config.yml | 2 +- responses/06_steps-activity.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.yml b/config.yml index b0e44a1..32ea40c 100644 --- a/config.yml +++ b/config.yml @@ -14,6 +14,7 @@ template: # Repo artifacts # repositoryUrl +# actionsUrl # 1. (Issue) Start here! # welcomeIssueUrl # welcomeIssueNumber @@ -299,7 +300,6 @@ steps: listCol: "%actions.listColumns.data%" columnID: "%actions.listColumns.data.0.id%" quicklink: "%payload.repository.html_url%/edit/master/.github/workflows/my-workflow.yml" - actionsTab: "%paylaod.repository.html_url%/actions" - title: Create better comments description: Use a templated repsonse as the comment body diff --git a/responses/06_steps-activity.md b/responses/06_steps-activity.md index d01769e..d1973b9 100644 --- a/responses/06_steps-activity.md +++ b/responses/06_steps-activity.md @@ -2,7 +2,7 @@ We will make the following changes to the current workflow file: -- Name each step so we can easily keep track of it in the [actions tab]({{actionsTab}}) +- Name each step so we can easily keep track of it in the [actions tab]({{store.actionsUrl}}) - Use expressions to determine `if` a step should execute ### :keyboard: Activity: Add newly opened issue to project board From f480832dd28d818f5a4c5253f18a0e769edd8104 Mon Sep 17 00:00:00 2001 From: Hector Alfaro Date: Tue, 7 Apr 2020 08:40:14 -0400 Subject: [PATCH 43/43] add image of working issue --- course-details.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/course-details.md b/course-details.md index 07079ff..0d4e726 100644 --- a/course-details.md +++ b/course-details.md @@ -13,7 +13,7 @@ In this course you will learn how to: ## What you'll build -![Need Screenshot](https://user-images.githubusercontent.com/38021615/77487200-124f0000-6def-11ea-9622-813e5ed08d95.png) +![A user opens an issue, the GitHub Actions bot responds with a welcome message. Another window shows that the issue has been added to a project board.](https://user-images.githubusercontent.com/16547949/78669798-cf8b2e80-78aa-11ea-885e-65e72fa22379.png) In this course you will automatically generate a comment on every new issue using a templated response. Additionally, if this issue is labeled as a bug it will be automatically added to the "needs triage" column of a project board. pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy