Skip to content

Test multiline input #202

Test multiline input

Test multiline input #202

Workflow file for this run

name: GitHub CI
on:
push:
pull_request:
workflow_dispatch:
inputs:
hello:
description: hello
required: true
type: boolean
world:
description: world
required: false
type: boolean
greeting:
description: greeting
type: string
default: github actions hello
jobs:
trial-multiline:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Multiline variables
run: |
echo "MULTILINE=${{
inputs.hello == 'hello' &&
inputs.world == 'world'
}}" >> $GITHUB_ENV
- name: Check greeting
env:
GREETING: ${{ inputs.greeting }}
run: echo "greeting=$(echo "${GREETING}" | sed -e 's/./&-/g')" >> $GITHUB_ENV
- name: Check env
run: echo "${MULTILINE}"
- name: Multiline input
uses: ./.github/actions/test
with:
nice-input: |
hello
world
# trial-deno:
# runs-on: ${{ matrix.os }}
#
# strategy:
# fail-fast: false
# matrix:
# os:
# - ubuntu-latest
# - macos-13
# - macos-14
# - windows-latest
# deno-version:
# - v1.x
# # - "1.27.2"
# # - "1.27.1"
# # - "1.27.0"
#
# steps:
# - name: Setup Deno
# uses: denoland/setup-deno@v1
# with:
# deno-version: ${{ matrix.deno-version }}
#
# - name: Deno.systemMemoryInfo
# run: deno eval 'console.log(Deno.systemMemoryInfo());'
#
# - name: os.cpus
# run: deno eval 'import os from "node:os";console.log(os.cpus());'
# trial-secret:
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout
# uses: actions/checkout@v4
#
# - name: Set secret to env
# run: echo "MY_SECRET=${{ secrets.SECRET_VALUE }}" >> $GITHUB_ENV
#
# - name: Use env
# uses: ./.github/actions/test
# with:
# example: ${{ env.MY_SECRET }}
#
# trial-gh:
# runs-on: ubuntu-latest
#
# steps:
# - name: Show context
# run: |
# (
# echo "github.event_name=${{ github.event_name }}"
# echo "${{ toJSON(github.event) }}"
# ) || true
#
# - uses: actions/checkout@v4
#
# - name: Commit
# if: github.ref_name == 'master'
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# grep -qv hello dir/sample.txt
# echo hello >> dir/sample.txt
# git config --local user.name 'github-actions[bot]'
# git config --local user.email 'github-actions[bot]@users.noreply.github.com'
# git switch -c trial/gh
# git add dir/sample.txt
# git commit -m 'Add message'
# git push -u origin trial/gh
#
# - name: Create pull request
# if: github.ref_name == 'master'
# id: pull_request
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# cat << EOT > /tmp/message
# ### Test
#
# * message 1
# * message 2
# EOT
# gh pr create --base master --title 'trial: Add message' --body-file /tmp/message | tee /tmp/pull_request
# echo "::set-output name=url::$(cat /tmp/pull_request)"
#
# - name: Merge pull request
# if: github.ref_name == 'master'
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# gh pr merge ${{ steps.pull_request.outputs.url }} --auto --merge --delete-branch
#
# setup:
# runs-on: ubuntu-latest
#
# outputs:
# env: ${{ toJSON(env) }}
# matrix: ${{ steps.matrix.outputs.json }}
#
# env:
# VERSION: v1.0
# URL: https://github.com/
#
# steps:
# - uses: actions/checkout@v4
#
# - name: Matrix
# id: matrix
# uses: ./.github/actions/generate-matrix
# with:
# matrix: |
# compiler:
# - clang
# - gcc
# arch:
# - x86_64
# - arm64
# include:
# - compiler: gcc
# arch: powerpc
# exclude:
# - compiler: gcc
# arch: arm64
#
# prepare:
# needs: setup
#
# if: always()
#
# runs-on: ubuntu-latest
#
# env: ${{ fromJSON(needs.setup.outputs.env) }}
#
# strategy:
# fail-fast: false
# matrix: ${{ fromJSON(needs.setup.outputs.matrix) }}
#
# steps:
# - name: Prepare
# run: |
# ${{ matrix.arch != 'dummy' }} \
# && echo "${{ matrix.compiler }},${{ matrix.arch }}" > artifact-${{ matrix.compiler }}-${{ matrix.arch }}.txt
#
# - uses: actions/upload-artifact@v3
# with:
# name: artifact-${{ matrix.compiler }}-${{ matrix.arch }}
# path: artifact-${{ matrix.compiler }}-${{ matrix.arch }}.txt
#
# trial:
# needs: [setup, prepare]
#
# if: always()
#
# runs-on: ubuntu-latest
#
# env: ${{ fromJSON(needs.setup.outputs.env) }}
#
# strategy:
# fail-fast: false
# matrix: ${{ fromJSON(needs.setup.outputs.matrix) }}
#
# steps:
# - uses: actions/download-artifact@v3
# with:
# name: artifact-${{ matrix.compiler }}-${{ matrix.arch }}
#
# - name: Trial
# run: cat artifact-${{ matrix.compiler }}-${{ matrix.arch }}.txt
#
# cleanup:
# needs: trial
#
# if: always()
#
# runs-on: ubuntu-latest
#
# steps:
# - name: Delete artifacts
# run: |
# headers=( \
# -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
# -H "Accept: application/vnd.github.v3+json" \
# )
# api_url=${{ github.api_url }}/repos/${{ github.repository }}/actions
# curl -s "${headers[@]}" ${api_url}/runs/${{ github.run_id }}/artifacts \
# | jq -r '.artifacts[].id' \
# | xargs -I{} curl -s -X DELETE "${headers[@]}" ${api_url}/artifacts/{}
#
# trial-stdio:
# runs-on: ${{ matrix.os }}
#
# strategy:
# fail-fast: false
# matrix:
# os:
# - macos-latest
# - ubuntu-latest
#
# steps:
# - name: Show stdio
# run: |
# echo 'altscreen on' >screenrc
# screen -dmLU -c screenrc -S show-stdio bash -c 'sleep 3 & lsof -p $!'
# while screen -list 2>/dev/null | grep -qs show-stdio; do sleep 1; done
# cat screenlog.0