Skip to content

Create a#4

Open
JoeyB26 wants to merge 8 commits intomainfrom
JoeyB26-patch-2-1
Open

Create a#4
JoeyB26 wants to merge 8 commits intomainfrom
JoeyB26-patch-2-1

Conversation

@JoeyB26
Copy link
Owner

@JoeyB26 JoeyB26 commented Jul 2, 2021

No description provided.

@github-learning-lab
Copy link

Nice work, you committed a Dockerfile. You'll notice at the end of the Dockerfile, we refer to an entrypoint script.

ENTRYPOINT ["/entrypoint.sh"]

The entrypoint.sh script will be run in Docker, and it will define what the action is really going to be doing.

Step 2: Add an entrypoint script

An entrypoint script must exist in our repository so that Docker has something to execute.

⌨️ Activity: Add an entrypoint script and commit it to your branch

  1. As a part of this branch and pull request, create a file in the /action-a/ directory titled entrypoint.sh. You can do so with this quicklink

  2. Add the following content to the entrypoint.sh file:

    #!/bin/sh -l
    
    sh -c "echo Hello world my name is $INPUT_MY_NAME"
  3. Stage and commit the changes

  4. Push the changes to GitHub


I'll respond when I detect a new commit on this branch.

@github-learning-lab
Copy link

Nice work adding the entrypoint.sh script.

In entrypoint.sh, all we're doing is outputting a "Hello world" message using an environment variable called MY_NAME.

Next, we'll define the action.yml file which contains the metadata for our action.

action.yml

All actions require a metadata file that uses YAML syntax. The data in the metadata file defines the inputs, outputs and main entrypoint for your action.

Step 3: Add an action metadata file

We will use an input parameter to read in the value of MY_NAME.

⌨️ Activity: Create action.yml

  1. As a part of this branch and pull request, create a file titled action-a/action.yml. You can do so using this quicklink or manually.

  2. Add the following content to the action.yml file:

    name: "Hello Actions"
    description: "Greet someone"
    author: "octocat@github.com"
    
    inputs:
      MY_NAME:
        description: "Who to greet"
        required: true
        default: "World"
    
    runs:
      using: "docker"
      image: "Dockerfile"
    
    branding:
      icon: "mic"
      color: "purple"
  3. Stage and commit the changes

  4. Push the changes to GitHub


I'll respond when I detect a new commit on this branch.

Teaching AI to love
@github-learning-lab
Copy link

Next, we'll define a workflow that uses the GitHub Action.

Workflow Files

Workflows are defined in special files in the .github/workflows directory, named main.yml.

Workflows can execute based on your chosen event. For this lab, we'll be using the push event.

We'll break down each line of the workflow in the next step.

Step 4: Start your workflow file

First, we'll add the structure of the workflow.

⌨️ Activity: Name and trigger your workflow

  1. Create a file titled .github/workflows/main.yml. You can do so using this quicklink or manually:
    • As a part of this branch and pull request, create a workflows directory nested inside the .github directory.
    • In the new .github/workflows/ directory, create a file titled main.yml
  2. Add the following content to the main.yml file:
    name: A workflow for my Hello World file
    on: push
  3. Stage and commit the changes
  4. Push the changes to GitHub
Trouble pushing? Click here.

The main.yml file cannot be edited using an integration. Try editing the file using the web interface, or your command line.

It is possible that you are using an integration (like GitHub Desktop or any other tool that authenticates as you and pushes on your behalf) if you receive a message like the one below:

To https://github.com/your-username/your-repo.git
 ! [remote rejected] your-branch -> your-branch (refusing to allow an integration to update main.yml)
error: failed to push some refs to 'https://github.com/your-username/your-repo.git'


I'll respond when I detect a new commit on this branch.

@JoeyB26 JoeyB26 changed the title Create Dockerfile Create a Jul 3, 2021
@JoeyB26
Copy link
Owner Author

JoeyB26 commented Jul 3, 2021

#define MESSAGE (const unsigned char *) "Message"
#define MESSAGE_LEN 7
#define CIPHERTEXT_LEN (crypto_box_SEALBYTES + MESSAGE_LEN)

/* Recipient creates a long-term key pair */
unsigned char recipient_pk[crypto_box_PUBLICKEYBYTES];
unsigned char recipient_sk[crypto_box_SECRETKEYBYTES];
crypto_box_keypair(recipient_pk, recipient_sk);

/* Anonymous sender encrypts a message using an ephemeral key pair

  • and the recipient's public key */
    unsigned char ciphertext[CIPHERTEXT_LEN];
    crypto_box_seal(ciphertext, MESSAGE, MESSAGE_LEN, recipient_pk);

/* Recipient decrypts the ciphertext /
unsigned char decrypted[MESSAGE_LEN];
if (crypto_box_seal_open(decrypted, ciphertext, CIPHERTEXT_LEN,
recipient_pk, recipient_sk) != 0) {
/
message corrupted or not intended for this recipient */

@JoeyB26
Copy link
Owner Author

JoeyB26 commented Jul 3, 2021

If the salt loses its flavor what good is it? Well, maybe here it does, who knows?

@github-learning-lab
Copy link

The file main.yml isn't where I expected. Here are some troubleshooting steps that might help.

Problem Solution
The file isn't called main.yml (case sensitive). Rename the file using the UI or your CLI.
The directory .github doesn't exist. Create the .github folder and move main.yml to .github.
The main.yml file isn't inside the .github folder. Move main.yml to .github.

When I detect your new commit, I'll respond in this pull request.

@github-learning-lab
Copy link

The file main.yml isn't where I expected. Here are some troubleshooting steps that might help.

Problem Solution
The file isn't called main.yml (case sensitive). Rename the file using the UI or your CLI.
The directory .github doesn't exist. Create the .github folder and move main.yml to .github.
The main.yml file isn't inside the .github folder. Move main.yml to .github.

When I detect your new commit, I'll respond in this pull request.

@github-learning-lab
Copy link

The file main.yml isn't where I expected. Here are some troubleshooting steps that might help.

Problem Solution
The file isn't called main.yml (case sensitive). Rename the file using the UI or your CLI.
The directory .github doesn't exist. Create the .github folder and move main.yml to .github.
The main.yml file isn't inside the .github folder. Move main.yml to .github.

When I detect your new commit, I'll respond in this pull request.

@github-learning-lab
Copy link

The file main.yml isn't where I expected. Here are some troubleshooting steps that might help.

Problem Solution
The file isn't called main.yml (case sensitive). Rename the file using the UI or your CLI.
The directory .github doesn't exist. Create the .github folder and move main.yml to .github.
The main.yml file isn't inside the .github folder. Move main.yml to .github.

When I detect your new commit, I'll respond in this pull request.

@github-learning-lab
Copy link

The file main.yml isn't where I expected. Here are some troubleshooting steps that might help.

Problem Solution
The file isn't called main.yml (case sensitive). Rename the file using the UI or your CLI.
The directory .github doesn't exist. Create the .github folder and move main.yml to .github.
The main.yml file isn't inside the .github folder. Move main.yml to .github.

When I detect your new commit, I'll respond in this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants