File tree Expand file tree Collapse file tree 7 files changed +11
-24
lines changed Expand file tree Collapse file tree 7 files changed +11
-24
lines changed Original file line number Diff line number Diff line change 44 The first step is always the hardest, so pick something easy!
55 Link to docs.github.com for further explanations.
66 Encourage users to open new tabs for steps!
7- TBD-step-1-notes.
87-->
98
109## Step 1: Removing sensitive data
Original file line number Diff line number Diff line change 22 <<< Author notes: Step 2 >>>
33 Start this step by acknowledging the previous step.
44 Define terms and link to docs.github.com.
5- TBD-step-2-notes.
65-->
76
87## Step 2: Removing a file from Git history using BFG Repo-Cleaner
Original file line number Diff line number Diff line change 22 <<< Author notes: Step 3 >>>
33 Start this step by acknowledging the previous step.
44 Define terms and link to docs.github.com.
5- TBD-step-3-notes.
65-->
76
87## Step 3: Avoiding future commits with ` .env `
Original file line number Diff line number Diff line change 7070 token : ${{ secrets.GITHUB_TOKEN }}
7171 from_step : 0
7272 to_step : 1
73- branch_name : tbd-branch-name
Original file line number Diff line number Diff line change 11name : Step 1, Removing sensitive data
22
3- # This step triggers after TBD-step-1-event-desc.
43# This workflow updates from step 1 to step 2.
54
6- # This will run every time we TBD-step-1-event-desc .
5+ # This will run every time we push a `.env` file .
76# Reference: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
87on :
98 workflow_dispatch :
109 # Add events that trigger this workflow.
11- # TBD-step-1-event:
1210 push :
1311 paths :
1412 - .env
3331 outputs :
3432 current_step : ${{ steps.get_step.outputs.current_step }}
3533
36- on_TBD-step-1-event :
37- name : On TBD-step-1-event
34+ on_push-dotenv-file :
35+ name : On push of .env file
3836 needs : get_current_step
3937
4038 # We will only run this action when:
7472 token : ${{ secrets.GITHUB_TOKEN }}
7573 from_step : 1
7674 to_step : 2
77- branch_name : tbd-branch-name
Original file line number Diff line number Diff line change 11name : Step 2, Removing a file with BFG Repo-Cleaner
22
3- # This step triggers after TBD-step-2-event-desc.
43# This workflow updates from step 2 to step 3.
54
6- # This will run every time we TBD-step-2-event-desc .
5+ # This will run every time we push to the repository .
76# Reference: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
87on :
98 workflow_dispatch :
109 # Add events that trigger this workflow.
11- # TBD-step-2-event:
1210 push :
1311
1412# Reference: https://docs.github.com/en/actions/security-guides/automatic-token-authentication
3129 outputs :
3230 current_step : ${{ steps.get_step.outputs.current_step }}
3331
34- on_TBD-step-2-event :
35- name : On TBD-step-2-event
32+ on_push :
33+ name : On push
3634 needs : get_current_step
3735
3836 # We will only run this action when:
5452 with :
5553 fetch-depth : 0 # Let's get all the branches.
5654
57- # TBD- step-2-additional-steps
55+ # Logic for step 2
5856 - name : Ensure .env is gone from history
5957 run : |
6058 if [ -n "$(git log --stat --all -- .env)" ]; then
7270 token : ${{ secrets.GITHUB_TOKEN }}
7371 from_step : 2
7472 to_step : 3
75- branch_name : tbd-branch-name
Original file line number Diff line number Diff line change 11name : Step 3, Avoiding future commits with .env
22
3- # This step triggers after TBD-step-3-event-desc.
43# This workflow updates from step 3 to step 4.
54
6- # This will run every time we TBD-step-3-event-desc .
5+ # This will run every time we push `.gitignore` .
76# Reference: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
87on :
98 workflow_dispatch :
109 # Add events that trigger this workflow.
11- # TBD-step-3-event:
1210 push :
1311 paths :
1412 - .gitignore
3331 outputs :
3432 current_step : ${{ steps.get_step.outputs.current_step }}
3533
36- on_TBD-step-3-event :
37- name : On TBD-step-3-event
34+ on_push-gitignore :
35+ name : On push of .gitignore
3836 needs : get_current_step
3937
4038 # We will only run this action when:
5654 with :
5755 fetch-depth : 0 # Let's get all the branches.
5856
59- # TBD- step-3-additional-steps
57+ # Logic for step 3
6058 - name : Check if .gitignore contains .env
6159 run : |
6260 if grep -qw ".env" .gitignore; then
7472 token : ${{ secrets.GITHUB_TOKEN }}
7573 from_step : 3
7674 to_step : X
77- branch_name : tbd-branch-name
You can’t perform that action at this time.
0 commit comments