diff --git a/.github/workflows/2nd.yml b/.github/workflows/2nd.yml new file mode 100644 index 0000000..6cdc3fa --- /dev/null +++ b/.github/workflows/2nd.yml @@ -0,0 +1,10 @@ +name: 2nd Workflow +on: workflow_dispatch +jobs: + first-job: + runs-on: ubuntu-latest + steps: + - name: print greeting + run: | + echo " GITHUB ACTIONS " + echo " Good Bye" diff --git a/.github/workflows/S3copy.yml b/.github/workflows/S3copy.yml new file mode 100644 index 0000000..ae92bcf --- /dev/null +++ b/.github/workflows/S3copy.yml @@ -0,0 +1,29 @@ +name: Copy Files between S3 Buckets + +on: + workflow_dispatch: + + +jobs: + copy-files: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up AWS CLI + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-east-1 + + - name: Copy Files + run: | + # Define your source and target S3 bucket paths + SOURCE_BUCKET="s3://ghtestworkflow/pipeline.PNG" + TARGET_BUCKET="s3://ghworkflow1/foldertest/" + + # Use AWS CLI to copy files from source to target + aws s3 cp $SOURCE_BUCKET $TARGET_BUCKET --recursive diff --git a/.github/workflows/cherrypick_PR.yml b/.github/workflows/cherrypick_PR.yml index 33857d9..17067ea 100644 --- a/.github/workflows/cherrypick_PR.yml +++ b/.github/workflows/cherrypick_PR.yml @@ -1,4 +1,4 @@ -name: Cherry-Pick and Raise PR +name: Cherry-Pick Commits on: push: branches: diff --git a/.github/workflows/ghpat.yml b/.github/workflows/ghpat.yml new file mode 100644 index 0000000..2b6a9d7 --- /dev/null +++ b/.github/workflows/ghpat.yml @@ -0,0 +1,23 @@ +name: Use GH_PAT Secret + +on: + push: + branches: + - main + +jobs: + create-issue: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Create Issue + env: + GH_PAT: ${{ secrets.GH_PAT }} + run: | + # Use the GH_PAT secret to create an issue + curl -X POST -H "Authorization: token $GH_PAT" \ + -d '{"title":"New Issue Created by Workflow", "body":"This issue is created using a GitHub Actions workflow."}' \ + https://api.github.com/repos/${{ github.repository }}/issues diff --git a/.github/workflows/jsonread.yml b/.github/workflows/jsonread.yml new file mode 100644 index 0000000..01b1060 --- /dev/null +++ b/.github/workflows/jsonread.yml @@ -0,0 +1,35 @@ +name: Extract JSON Values + +on: + push: + branches: + - main + +jobs: + extract-values: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Read JSON file + run: | + json_data=$(cat input/input.json) + echo "::set-output name=json_data::$json_data" + + - name: Extract values from JSON + id: extract + run: | + name=$(echo "$json_data" | jq -r '.name') + age=$(echo "$json_data" | jq -r '.age') + car=$(echo "$json_data" | jq -r '.car') + echo "::set-output name=name::$name" + echo "::set-output name=age::$age" + echo "::set-output name=car::$car" + + - name: Display extracted values + run: | + echo "Name: ${{ steps.extract.outputs.name }}" + echo "Age: ${{ steps.extract.outputs.age }}" + echo "Car: ${{ steps.extract.outputs.car }}" diff --git a/ghtest b/ghtest new file mode 100644 index 0000000..17f8d82 --- /dev/null +++ b/ghtest @@ -0,0 +1 @@ +test file GHpat test diff --git a/input/input.json b/input/input.json new file mode 100644 index 0000000..38c0de2 --- /dev/null +++ b/input/input.json @@ -0,0 +1,3 @@ +'{"name":"John", +"age":30, +"car":null}' \ No newline at end of file