diff --git a/.github/workflows/custom-action.yml b/.github/workflows/custom-action.yml index 7a87b53f1..3d815d717 100644 --- a/.github/workflows/custom-action.yml +++ b/.github/workflows/custom-action.yml @@ -1,3 +1,4 @@ +name: 'custom-action.yml' on: [push] jobs: @@ -12,4 +13,4 @@ jobs: name: 'Brown' # Use the output from the `hello` step - name: Get the Output - run: echo "The time was ${{ steps.hello.outputs.greeting }}" \ No newline at end of file + run: echo "The time was ${{ steps.hello.outputs.greeting }}" diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml new file mode 100644 index 000000000..46774343e --- /dev/null +++ b/.github/workflows/greetings.yml @@ -0,0 +1,16 @@ +name: Greetings + +on: [pull_request_target, issues] + +jobs: + greeting: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: + - uses: actions/first-interaction@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + issue-message: "Message that will be displayed on users' first issue" + pr-message: "Message that will be displayed on users' first pull request" diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml new file mode 100644 index 000000000..30acdb007 --- /dev/null +++ b/.github/workflows/manual.yml @@ -0,0 +1,32 @@ +name: Manual Trigger with Params + +on: + workflow_dispatch: + inputs: + name: + description: 'Name of the person to greet' + required: true + type: string + greeting: + description: 'Type of greeting' + required: true + type: string + data: + description: 'Base64 encoded content of a file' + required: false + type: string + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Decode File Content + run: | + echo "${{ inputs.data }}" | base64 --decode > ./decoded_file.txt + - name: Display Greeting + run: | + echo "${{ inputs.greeting }}, ${{ inputs.name }}!" + - name: Display File Content + run: | + echo "Contents of the file:" + cat ./decoded_file.txt diff --git a/.github/workflows/multi-event-trigger.yml b/.github/workflows/multi-event-trigger.yml new file mode 100644 index 000000000..48d832889 --- /dev/null +++ b/.github/workflows/multi-event-trigger.yml @@ -0,0 +1,21 @@ +name: 'multi-event-trigger.yml' + +on: + push: + branches: + - main + - dev + pull_request: + branches: + - main + +jobs: + hello_world: + runs-on: ubuntu-latest + steps: + - name: "Echo Basic Information" + run: | + echo "REF: $GITHUB_REF" + echo "Job ID: $GITHUB_JOB" + echo "Action: $GITHUB_ACTION" + echo "Actor: $GITHUB_ACTOR" diff --git a/.github/workflows/schedule.yml b/.github/workflows/schedule.yml new file mode 100644 index 000000000..d1a12e4fd --- /dev/null +++ b/.github/workflows/schedule.yml @@ -0,0 +1,12 @@ +name: 'schedule.yml' + +on: + schedule: + - cron: '*/2 * * * *' + +jobs: + hello_world: + runs-on: ubuntu-latest + steps: + - name: Echo current time + run: echo "The current server time is $(date)" diff --git a/README.md b/README.md index 43fc9143d..2d0dab5af 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Github-Examples A repo containing GitHub for programmatic examples +# 1) Change and commit/push to readme.md to trigger "multi-event" action for push event into main or dev branch