Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Are You Awake Yet Action

Aperta
#623 2 commenti 0 reazioni 5 assegnatari Vedi su GitHub

@dataeducator ci sta già lavorando.

Dal 8/11/2023.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

epic good first issue oss workflows

Part of the OSS Architecture track

Task

Suggestions: try this prompt with Copilot "how to create a spellcheck GitHub Action like this one https://github.com/marketplace/actions/are-they-awake-yet"

Or you can debug the following output:
To create a GitHub Action in your ProgramEquity/amplify repository like the "Are They Awake Yet?" action, you can follow these steps:

  1. Create a new GitHub repository for your action.

  2. Create a new file in your repository called Dockerfile with the following contents:


RUN apk add --no-cache curl
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

This Dockerfile sets up a Node.js environment and installs the curl package. It also copies the entrypoint.sh script to the container and sets it as the entrypoint.

  1. Create a new file in your repository called entrypoint.sh with the following contents:
#!/bin/sh -l

curl -s https://awake-api.herokuapp.com/awake/$1 | grep -q "true"
if [ $? -eq 0 ]; then
  echo "$1 is awake!"
  exit 0
else
  echo "$1 is asleep :("
  exit 1
fi

This shell script is the entrypoint for the Docker container. It uses the curl command to make a request to the "Are They Awake Yet?" API with the specified URL. It then uses grep to check if the response contains the string "true". If the URL is awake, it prints a success message and exits with code 0. If the URL is asleep, it prints a failure message and exits with code 1.

Create a new file in your repository called action.yml with the following contents:

name: Are They Awake Yet?
description: Check if a website is awake
inputs:
  url:
    description: 'The URL to check'
    required: true
runs:
  using: 'docker'
  image: 'Dockerfile'

This YAML file defines the GitHub Action. It specifies the name and description of the action, as well as an input for the URL to check. It also specifies that the action should run using Docker, and sets the Docker image to the Dockerfile we created earlier.

Commit and push your changes to the repository.

Use the actions/checkout action to check out the repository in your workflow.

Use the ProgramEquity/amplifyaction to run the "Are They Awake Yet?" action in your workflow, passing the URL to check as an input.

Resources:
Lingua principale
JavaScript
Stelle
120
Fork
101
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OpenSourceFellows/amplify

Tutte le issue di OpenSourceFellows/amplify

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.